diff options
Diffstat (limited to 'src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp')
-rw-r--r-- | src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 6691659345..94f2cd88a0 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -15,6 +15,8 @@ #include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qpointingdevice_p.h> +#include <QtCore/qpointer.h> + #include <mutex> #ifdef Q_OS_FREEBSD @@ -44,7 +46,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; Q_LOGGING_CATEGORY(qLcEvdevTouch, "qt.qpa.input") -Q_LOGGING_CATEGORY(qLcEvents, "qt.qpa.input.events") +Q_STATIC_LOGGING_CATEGORY(qLcEvents, "qt.qpa.input.events") /* android (and perhaps some other linux-derived stuff) don't define everything * in linux/input.h, so we'll need to do that ourselves. @@ -150,12 +152,12 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co m_filtered(false), m_prediction(0) { for (const QString &arg : args) { - if (arg == QStringLiteral("force_window")) + if (arg == u"force_window") m_forceToActiveWindow = true; - else if (arg == QStringLiteral("filtered")) + else if (arg == u"filtered") m_filtered = true; - else if (arg.startsWith(QStringLiteral("prediction="))) - m_prediction = arg.mid(11).toInt(); + else if (const QStringView prefix = u"prediction="; arg.startsWith(prefix)) + m_prediction = QStringView(arg).mid(prefix.size()).toInt(); } } @@ -181,7 +183,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const int rotationAngle = 0; bool invertx = false; bool inverty = false; - for (int i = 0; i < args.count(); ++i) { + for (int i = 0; i < args.size(); ++i) { if (args.at(i).startsWith("rotate"_L1)) { QString rotateArg = args.at(i).section(u'=', 1, 1); bool ok; @@ -192,6 +194,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const case 180: case 270: rotationAngle = argValue; + break; default: break; } @@ -565,7 +568,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) // Until that use a temporary key. int key = m_currentData.trackingId; if (key == -1) - key = m_contacts.count(); + key = m_contacts.size(); m_contacts.insert(key, m_currentData); m_currentData = Contact(); @@ -774,7 +777,7 @@ void QEvdevTouchScreenData::reportPoints() // Map the coordinates based on the normalized position. QPA expects 'area' // to be in screen coordinates. - const int pointCount = m_touchPoints.count(); + const int pointCount = m_touchPoints.size(); for (int i = 0; i < pointCount; ++i) { QWindowSystemInterface::TouchPoint &tp(m_touchPoints[i]); |