diff options
author | Libor Tomsik <libor@tomsik.eu> | 2013-03-19 19:15:25 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-20 10:09:28 +0100 |
commit | 27b4fe96b59e9e63d1e570e802c072e9afdfb2d4 (patch) | |
tree | 9975f2238c8ef133db6c5e6d672513240a5a7388 /src/platformsupport/input/evdevtouch | |
parent | d1f2309166295f2669df7d7f8ee996e35b35aa3c (diff) |
Added configuration environment variables for evdev input plugins.
Added new environment parameters QT_QPA_EVDEV_KEYBOARD_PARAMETERS,
QT_QPA_EVDEV_MOUSE_PARAMETERS and QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS to the
evdevkeyboard, evdevmouse and evdevtouch input plugins. In order to get
evdevkeyboard support for keyboard layout, explicit device file and more.
Change-Id: I0d9139cd0d4b682ab2df7c16ebd16d4d9c0c0ab0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/platformsupport/input/evdevtouch')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 8 | ||||
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouch_p.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 8c86eee469..2c93da147e 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array) return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1; } -QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject *parent) +QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent) : QObject(parent), m_notify(0), m_fd(-1), d(0) #ifdef USE_MTDEV , m_mtdev(0) @@ -170,7 +170,13 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject QString dev; // only the first device argument is used for now + QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS")); + + if (spec.isEmpty()) + spec = specification; + QStringList args = spec.split(QLatin1Char(':')); + for (int i = 0; i < args.count(); ++i) { if (args.at(i).startsWith(QLatin1String("/dev/"))) { dev = args.at(i); diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h index b4de2ca088..7e838c9134 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h @@ -63,7 +63,7 @@ class QEvdevTouchScreenHandler : public QObject Q_OBJECT public: - explicit QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0); + explicit QEvdevTouchScreenHandler(const QString &specification = QString(), QObject *parent = 0); ~QEvdevTouchScreenHandler(); private slots: |