diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-08 09:21:58 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-11 22:00:19 +0200 |
commit | 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad (patch) | |
tree | a9e5265252c2ccfead34d4e42fe8149358bff0f1 /src/quick/items/qquicktextinput.cpp | |
parent | 974c8da34d79cd8fc417ff5d69bc00c1e910e5ac (diff) |
Replace calls to deprecated QEvent accessor functions
Several event accessors were deprecated in
qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5.
Replacements were generated by clazy using the new qevent-accessors check:
$ export CLAZY_CHECKS=qevent-accessors
$ export CLAZY_EXPORT_FIXES=1
$ ../qt6/configure -platform linux-clang -developer-build -debug
-no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy
$ make
$ cd ../../qt6/qtdeclarative
$ find . -name "*.clazy.yaml"
$ clang-apply-replacements .
Task-number: QTBUG-20885
Task-number: QTBUG-84775
Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 39424d5f9d..163df3522f 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1544,11 +1544,11 @@ void QQuickTextInput::mouseDoubleClickEvent(QMouseEvent *event) #if QT_CONFIG(im) d->commitPreedit(); #endif - int cursor = d->positionAt(event->localPos()); + int cursor = d->positionAt(event->position()); d->selectWordAtPos(cursor); event->setAccepted(true); if (!d->hasPendingTripleClick()) { - d->tripleClickStartPoint = event->localPos(); + d->tripleClickStartPoint = event->position(); d->tripleClickTimer.start(); } } else { @@ -1562,7 +1562,7 @@ void QQuickTextInput::mousePressEvent(QMouseEvent *event) { Q_D(QQuickTextInput); - d->pressPos = event->localPos(); + d->pressPos = event->position(); if (d->sendMouseEventToInputContext(event)) return; @@ -1580,7 +1580,7 @@ void QQuickTextInput::mousePressEvent(QMouseEvent *event) } bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse; - int cursor = d->positionAt(event->localPos()); + int cursor = d->positionAt(event->position()); d->moveCursor(cursor, mark); if (d->focusOnPress && !qGuiApp->styleHints()->setFocusOnTouchRelease()) @@ -1594,20 +1594,20 @@ void QQuickTextInput::mouseMoveEvent(QMouseEvent *event) Q_D(QQuickTextInput); if (d->selectPressed) { - if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance()) + if (qAbs(int(event->position().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance()) setKeepMouseGrab(true); #if QT_CONFIG(im) if (d->composeMode()) { // start selection int startPos = d->positionAt(d->pressPos); - int currentPos = d->positionAt(event->localPos()); + int currentPos = d->positionAt(event->position()); if (startPos != currentPos) d->setSelection(startPos, currentPos - startPos); } else #endif { - moveCursorSelection(d->positionAt(event->localPos()), d->mouseSelectionMode); + moveCursorSelection(d->positionAt(event->position()), d->mouseSelectionMode); } event->setAccepted(true); } else { @@ -1646,7 +1646,7 @@ bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event) { #if QT_CONFIG(im) if (composeMode()) { - int tmp_cursor = positionAt(event->localPos()); + int tmp_cursor = positionAt(event->position()); int mousePos = tmp_cursor - m_cursor; if (mousePos >= 0 && mousePos <= m_textLayout.preeditAreaText().length()) { if (event->type() == QEvent::MouseButtonRelease) { |