summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenubar.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-30 09:20:20 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-30 09:20:20 (GMT)
commita823334a1b61f7a8cf73d96cbc4cd0f71bdc3df7 (patch)
tree84d3040a66dfe755b79d361f28fe8bbf19c3ddb8 /src/gui/widgets/qmenubar.cpp
parent225aa3154d3c9940775254ed261d6dd8b9123c62 (diff)
downloadQt-a823334a1b61f7a8cf73d96cbc4cd0f71bdc3df7.zip
Qt-a823334a1b61f7a8cf73d96cbc4cd0f71bdc3df7.tar.gz
Qt-a823334a1b61f7a8cf73d96cbc4cd0f71bdc3df7.tar.bz2
QMenuBar: make sure to update the geometries when needed
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r--src/gui/widgets/qmenubar.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 7982d98..f4288ac 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -279,6 +279,7 @@ QRect QMenuBarPrivate::actionRect(QAction *act) const
void QMenuBarPrivate::focusFirstAction()
{
if(!currentAction) {
+ updateGeometries();
int index = 0;
while (index < actions.count() && actionRects.at(index).isNull()) ++index;
if (index < actions.count())
@@ -757,6 +758,7 @@ void QMenuBarPrivate::init()
QAction *QMenuBarPrivate::getNextAction(const int _start, const int increment) const
{
Q_Q(const QMenuBar);
+ const_cast<QMenuBarPrivate*>(this)->updateGeometries();
bool allowActiveAndDisabled = q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, 0, q);
const int start = (_start == -1 && increment == -1) ? actions.count() : _start;
const int end = increment == -1 ? 0 : actions.count() - 1;
@@ -1123,6 +1125,7 @@ void QMenuBar::mouseReleaseEvent(QMouseEvent *e)
void QMenuBar::keyPressEvent(QKeyEvent *e)
{
Q_D(QMenuBar);
+ d->updateGeometries();
int key = e->key();
if(isRightToLeft()) { // in reverse mode open/close key for submenues are reversed
if(key == Qt::Key_Left)
@@ -1597,6 +1600,7 @@ QSize QMenuBar::minimumSizeHint() const
ensurePolished();
QSize ret(0, 0);
+ const_cast<QMenuBarPrivate*>(d)->updateGeometries();
const int hmargin = style()->pixelMetric(QStyle::PM_MenuBarHMargin, 0, this);
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, 0, this);
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, 0, this);