diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-19 08:15:53 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-19 08:17:16 (GMT) |
commit | 500a851bb363567effca6d78b14a755bf56e37f1 (patch) | |
tree | f6e534305ec9a3808b8ed28aa1aa9a4daf489e3d | |
parent | 9a5b40a011bd1b15a67d83564af55011761f8ad9 (diff) | |
download | Qt-500a851bb363567effca6d78b14a755bf56e37f1.zip Qt-500a851bb363567effca6d78b14a755bf56e37f1.tar.gz Qt-500a851bb363567effca6d78b14a755bf56e37f1.tar.bz2 |
QMenu: fixed a bug that prevented from opening a context menu with mid
button and still be able to activate an action
Task-number: 253494
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 6bbf4e8..fc55a2c 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1826,7 +1826,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) if (d->scroll && d->scroll->scrollFlags != QMenuPrivate::QMenuScroller::ScrollNone && !style()->styleHint(QStyle::SH_Menu_FillScreenWithScroll, 0, this)) { int below_height = above_height + d->scroll->scrollOffset; - for(int i2 = i; i2 < (int)d->actionList.count(); i2++) + for(int i2 = i; i2 < d->actionList.count(); i2++) below_height += d->actionRects.value(d->actionList.at(i2)).height(); size.setHeight(below_height); } @@ -2263,7 +2263,7 @@ void QMenu::mouseReleaseEvent(QMouseEvent *e) break; } } - if (e->button() == Qt::LeftButton || (e->button() == Qt::RightButton && isContextMenu)) + if (e->button() || isContextMenu) #endif d->activateAction(action, QAction::Trigger); } @@ -2746,7 +2746,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e) if (d->hasHadMouse && !rect().contains(e->pos())) d->setCurrentAction(0); return; - } else if(e->buttons() & (Qt::LeftButton | Qt::RightButton)) { + } else if(e->buttons()) { d->mouseDown = this; } if (d->sloppyRegion.contains(e->pos())) { |