summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index fbf483087e..1b0da6297b 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
@@ -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]);
@@ -901,7 +904,7 @@ void QEvdevTouchScreenHandlerThread::filterAndSendTouchPoints()
} else {
// Update our estimate for the touch rate. We're making the assumption
- // that this value will be mostly accurate with the occational bump,
+ // that this value will be mostly accurate with the occasional bump,
// so we're weighting the existing value high compared to the update.
const double ratio = 0.9;
m_touchRate = sqrt(m_touchRate * m_touchRate * ratio + touchDelta * touchDelta * (1.0 - ratio));