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 | |
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')
-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 |