From 1c6c353ecc23a01368d785794d130131e3fb2553 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 11 Jun 2009 10:49:14 +0200 Subject: rename Qt::WA_AcceptedTouchBeginEvent to Qt::WA_WState_AcceptedTouchBeginEvent this is an internal widget state variable, so the name should reflect that (and we shouldn't include it in the docs either) --- doc/src/qnamespace.qdoc | 1 + src/corelib/global/qnamespace.h | 2 +- src/gui/kernel/qapplication.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index ed57566..3f84c00 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -1237,6 +1237,7 @@ \omitvalue WA_X11BypassTransientForHint \omitvalue WA_SetWindowModality \omitvalue WA_WState_WindowOpacitySet + \omitvalue WA_WState_AcceptedTouchBeginEvent */ /*! \typedef Qt::HANDLE 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; } -- cgit v0.12