diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-04-07 13:03:11 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-04-07 13:24:00 (GMT) |
commit | de007bd2a20a141aefe901408512c806879a2387 (patch) | |
tree | 0dd19ac158af1efbb38afb1d66604300e35e82b7 /src/gui/widgets/qtoolbar.cpp | |
parent | 573c370030d58a9d809beada61825302dda74eca (diff) | |
download | Qt-de007bd2a20a141aefe901408512c806879a2387.zip Qt-de007bd2a20a141aefe901408512c806879a2387.tar.gz Qt-de007bd2a20a141aefe901408512c806879a2387.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
Diffstat (limited to 'src/gui/widgets/qtoolbar.cpp')
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 |