summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-04 09:57:15 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-04 09:58:30 (GMT)
commit625f6b92a08d8ef2a1e5697fce28ca39d29917fe (patch)
tree85850b633d9d06ae48b33ec266ae0386942120b4 /src/gui/widgets/qmenu.cpp
parenta99fe8624a25f8a09fe9b3234306a4d8b3a3f38e (diff)
downloadQt-625f6b92a08d8ef2a1e5697fce28ca39d29917fe.zip
Qt-625f6b92a08d8ef2a1e5697fce28ca39d29917fe.tar.gz
Qt-625f6b92a08d8ef2a1e5697fce28ca39d29917fe.tar.bz2
Fixes QMenu to only have static POD members
This also fixes the autotests
Diffstat (limited to 'src/gui/widgets/qmenu.cpp')
-rw-r--r--src/gui/widgets/qmenu.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 5db14b8..9a4916e 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -85,9 +85,8 @@
QT_BEGIN_NAMESPACE
-QPointer<QMenu> QMenuPrivate::mouseDown;
-QBasicTimer QMenuPrivate::menuDelayTimer;
-QBasicTimer QMenuPrivate::sloppyDelayTimer;
+QMenu *QMenuPrivate::mouseDown = 0;
+int QMenuPrivate::sloppyDelayTimer = 0;
/* QMenu code */
// internal class used for the torn off popup
@@ -487,8 +486,8 @@ void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst)
if (action && action->isEnabled()) {
if (!delay)
q->internalDelayedPopup();
- else if (!QMenuPrivate::menuDelayTimer.isActive() && (!action->menu() || !action->menu()->isVisible()))
- QMenuPrivate::menuDelayTimer.start(delay, q);
+ else if (!menuDelayTimer.isActive() && (!action->menu() || !action->menu()->isVisible()))
+ menuDelayTimer.start(delay, q);
if (activateFirst && action->menu())
action->menu()->d_func()->setFirstActionActive();
} else if (QMenu *menu = activeMenu) { //hide the current item
@@ -2375,8 +2374,8 @@ QMenu::event(QEvent *e)
}
} break;
case QEvent::ContextMenu:
- if(QMenuPrivate::menuDelayTimer.isActive()) {
- QMenuPrivate::menuDelayTimer.stop();
+ if(d->menuDelayTimer.isActive()) {
+ d->menuDelayTimer.stop();
internalDelayedPopup();
}
break;
@@ -2809,7 +2808,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
}
if (d->sloppyRegion.contains(e->pos())) {
d->sloppyAction = action;
- QMenuPrivate::sloppyDelayTimer.start(style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this)*6, this);
+ QMenuPrivate::sloppyDelayTimer = startTimer(style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this)*6);
} else {
d->setCurrentAction(action, style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this));
}
@@ -2847,11 +2846,12 @@ QMenu::timerEvent(QTimerEvent *e)
d->scrollMenu((QMenuPrivate::QMenuScroller::ScrollDirection)d->scroll->scrollDirection);
if (d->scroll->scrollFlags == QMenuPrivate::QMenuScroller::ScrollNone)
d->scroll->scrollTimer.stop();
- } else if(QMenuPrivate::menuDelayTimer.timerId() == e->timerId()) {
- QMenuPrivate::menuDelayTimer.stop();
+ } else if(d->menuDelayTimer.timerId() == e->timerId()) {
+ d->menuDelayTimer.stop();
internalDelayedPopup();
- } else if(QMenuPrivate::sloppyDelayTimer.timerId() == e->timerId()) {
- QMenuPrivate::sloppyDelayTimer.stop();
+ } else if(QMenuPrivate::sloppyDelayTimer == e->timerId()) {
+ killTimer(QMenuPrivate::sloppyDelayTimer);
+ QMenuPrivate::sloppyDelayTimer = 0;
internalSetSloppyAction();
} else if(d->searchBufferTimer.timerId() == e->timerId()) {
d->searchBuffer.clear();