diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-04-07 13:03:11 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-08 02:32:24 (GMT) |
commit | e0b90b6cdfea29a2362d3ba825be7a816eaa7332 (patch) | |
tree | 5fa3e9864a6a2178c64bdc917e45c0822f6d6cf5 | |
parent | 9e7f2b2029c13888509ce25f1fd96e131fef28d9 (diff) | |
download | Qt-e0b90b6cdfea29a2362d3ba825be7a816eaa7332.zip Qt-e0b90b6cdfea29a2362d3ba825be7a816eaa7332.tar.gz Qt-e0b90b6cdfea29a2362d3ba825be7a816eaa7332.tar.bz2 |
fix tap-and-hold checkbox problem for Windows CE
Symptom: checkboxes didn't get checked if you press, hold for some
seconds and then release the mouse or stylus.
In QAbstractButton we reacted on the contextMenuEvent that gets sent if
the system recognizes the context menu gesture (tap and hold) and did
call setDown(false).
This change has been done because buttons in tool bars stayed in the
down state when displaying the context menu with this gesture.
I've now moved the handling of this to qtoolbar.cpp.
Task-number: 246619
Reviewed-by: thartman
(cherry picked from commit de007bd2a20a141aefe901408512c806879a2387)
-rw-r--r-- | src/gui/widgets/qabstractbutton.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qabstractbutton.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 11 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/gui/widgets/qabstractbutton.cpp b/src/gui/widgets/qabstractbutton.cpp index 330a7f8..61ed0ea 100644 --- a/src/gui/widgets/qabstractbutton.cpp +++ b/src/gui/widgets/qabstractbutton.cpp @@ -1248,15 +1248,6 @@ void QAbstractButton::timerEvent(QTimerEvent *e) } } -#if defined(Q_OS_WINCE) && !defined(QT_NO_CONTEXTMENU) -/*! \reimp */ -void QAbstractButton::contextMenuEvent(QContextMenuEvent *e) -{ - e->ignore(); - setDown(false); -} -#endif - /*! \reimp */ void QAbstractButton::focusInEvent(QFocusEvent *e) { diff --git a/src/gui/widgets/qabstractbutton.h b/src/gui/widgets/qabstractbutton.h index 6503a56..f0cbb05 100644 --- a/src/gui/widgets/qabstractbutton.h +++ b/src/gui/widgets/qabstractbutton.h @@ -143,9 +143,6 @@ protected: void focusOutEvent(QFocusEvent *e); void changeEvent(QEvent *e); void timerEvent(QTimerEvent *e); -#ifdef Q_OS_WINCE - void contextMenuEvent(QContextMenuEvent *e); -#endif #ifdef QT3_SUPPORT public: diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 85d6ea2..1babb6d 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -1153,6 +1153,17 @@ bool QToolBar::event(QEvent *event) if (d->mouseMoveEvent(static_cast<QMouseEvent*>(event))) return true; break; +#ifdef Q_OS_WINCE + case QEvent::ContextMenu: + { + QContextMenuEvent* contextMenuEvent = static_cast<QContextMenuEvent*>(event); + QWidget* child = childAt(contextMenuEvent->pos()); + QAbstractButton* button = qobject_cast<QAbstractButton*>(child); + if (button) + button->setDown(false); + } + break; +#endif case QEvent::Leave: if (d->state != 0 && d->state->dragging) { #ifdef Q_OS_WIN |