Qt 4.8
Functions
qscreenproxy_qws.cpp File Reference
#include <qscreenproxy_qws.h>
#include <qregexp.h>

Go to the source code of this file.

Functions

static int getDisplayId (const QString &spec)
 Returns the display ID that corresponds to the given spec. More...
 

Function Documentation

◆ getDisplayId()

static int getDisplayId ( const QString spec)
static

Returns the display ID that corresponds to the given spec.

Warning
This function is not part of the public interface.

Definition at line 262 of file qscreenproxy_qws.cpp.

Referenced by QProxyScreen::connect().

263 {
264  QRegExp regexp(QLatin1String(":(\\d+)\\b"));
265  if (regexp.lastIndexIn(spec) != -1) {
266  const QString capture = regexp.cap(1);
267  return capture.toInt();
268  }
269  return 0;
270 }
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
Definition: qstring.cpp:6090
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83