diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-30 09:05:44 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-30 09:05:44 (GMT) |
commit | 0a4930f7e0d324d9ec75e4fe8775b8acf21b4ce1 (patch) | |
tree | 374fefb0ab9225bb4273c8f5827e16e3cfa6741f /src | |
parent | aa5def2013cb362ddcb8cd4233f37ef936fe0302 (diff) | |
download | Qt-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')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 3 |
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())) { |