diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 78e2b08..4de431c 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -492,7 +492,7 @@ public: WA_TranslucentBackground = 120, WA_AcceptTouchEvents = 121, - WA_AcceptedTouchBeginEvent = 122, + WA_WState_AcceptedTouchBeginEvent = 122, // Add new attributes before this line WA_AttributeCount diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index e5cf0b5..7cb1ac1 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4055,7 +4055,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) touchEvent->setAccepted(acceptTouchEvents); res = acceptTouchEvents && d->notify_helper(widget, touchEvent); eventAccepted = touchEvent->isAccepted(); - widget->setAttribute(Qt::WA_AcceptedTouchBeginEvent, res && eventAccepted); + widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, res && eventAccepted); touchEvent->spont = false; if (res && eventAccepted) { // the first widget to accept the TouchBegin gets an implicit grab. @@ -5402,13 +5402,15 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, { // if the TouchBegin handler recurses, we assume that means the event // has been implicitly accepted and continue to send touch events - widget->setAttribute(Qt::WA_AcceptedTouchBeginEvent); + widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); res = QApplication::sendSpontaneousEvent(widget, &touchEvent) && touchEvent.isAccepted(); break; } default: - if (widget->testAttribute(Qt::WA_AcceptedTouchBeginEvent)) { + if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)) { + if (touchEvent.type() == QEvent::TouchEnd) + widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); (void) QApplication::sendSpontaneousEvent(widget, &touchEvent); res = true; } |