Qt 4.8
Classes | Functions
qscreenmulti_qws.cpp File Reference
#include "qscreenmulti_qws_p.h"
#include <qlist.h>
#include <qstringlist.h>
#include <qwidget.h>
#include <qdebug.h>

Go to the source code of this file.

Classes

class  QMultiScreenCursor
 
class  QMultiScreenPrivate
 

Functions

static QPoint filterDisplayOffset (QString &spec)
 
static int getDisplayId (const QString &spec)
 

Function Documentation

◆ filterDisplayOffset()

static QPoint filterDisplayOffset ( QString spec)
static

Definition at line 209 of file qscreenmulti_qws.cpp.

Referenced by QMultiScreen::connect().

210 {
211  QRegExp regexp(QLatin1String(":offset=(\\d+),(\\d+)\\b"));
212  if (regexp.indexIn(spec) == -1)
213  return QPoint();
214 
215  const int x = regexp.cap(1).toInt();
216  const int y = regexp.cap(2).toInt();
217  spec.remove(regexp.pos(0), regexp.matchedLength());
218  return QPoint(x, y);
219 }
The QRegExp class provides pattern matching using regular expressions.
Definition: qregexp.h:61
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
Definition: qstring.cpp:1867

◆ getDisplayId()

static int getDisplayId ( const QString spec)
static

Definition at line 199 of file qscreenmulti_qws.cpp.

Referenced by QMultiScreen::connect().

200 {
201  QRegExp regexp(QLatin1String(":(\\d+)\\b"));
202  if (regexp.lastIndexIn(spec) != -1) {
203  const QString capture = regexp.cap(1);
204  return capture.toInt();
205  }
206  return 0;
207 }
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