summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-30 09:05:44 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-30 09:05:44 (GMT)
commit0a4930f7e0d324d9ec75e4fe8775b8acf21b4ce1 (patch)
tree374fefb0ab9225bb4273c8f5827e16e3cfa6741f /src/gui/widgets/qmenu.cpp
parentaa5def2013cb362ddcb8cd4233f37ef936fe0302 (diff)
downloadQt-0a4930f7e0d324d9ec75e4fe8775b8acf21b4ce1.zip
Qt-0a4930f7e0d324d9ec75e4fe8775b8acf21b4ce1.tar.gz
Qt-0a4930f7e0d324d9ec75e4fe8775b8acf21b4ce1.tar.bz2
QMenu: fixed a crash when clicking on a menu with a submenu
Diffstat (limited to 'src/gui/widgets/qmenu.cpp')
-rw-r--r--src/gui/widgets/qmenu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 56b8cb1..31df3f6 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -483,9 +483,9 @@ void QMenuPrivate::setSyncAction()
void QMenuPrivate::setFirstActionActive()
{
Q_Q(QMenu);
+ updateActionRects();
const int scrollerHeight = q->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, 0, q);
for(int i = 0, saccum = 0; i < actions.count(); i++) {
- QAction *act = actions.at(i);
const QRect &rect = actionRects.at(i);
if (rect.isNull())
continue;
@@ -494,6 +494,7 @@ void QMenuPrivate::setFirstActionActive()
if (saccum > scroll->scrollOffset-scrollerHeight)
continue;
}
+ QAction *act = actions.at(i);
if (!act->isSeparator() &&
(q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, 0, q)
|| act->isEnabled())) {