summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-04-07 15:03:11 +0200
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-04-07 15:24:00 +0200
commitde007bd2a20a141aefe901408512c806879a2387 (patch)
tree0dd19ac158af1efbb38afb1d66604300e35e82b7
parent573c370030d58a9d809beada61825302dda74eca (diff)
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
-rw-r--r--src/gui/widgets/qabstractbutton.cpp9
-rw-r--r--src/gui/widgets/qabstractbutton.h3
-rw-r--r--src/gui/widgets/qtoolbar.cpp11
3 files changed, 11 insertions, 12 deletions
diff --git a/src/gui/widgets/qabstractbutton.cpp b/src/gui/widgets/qabstractbutton.cpp
index 330a7f8d79..61ed0ea625 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 6503a562a8..f0cbb05ef1 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 85d6ea23d9..1babb6d13a 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