diff options
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 51e38e6..68a0233 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -116,11 +116,9 @@ QSize QMenuBarExtension::sizeHint() const */ QAction *QMenuBarPrivate::actionAt(QPoint p) const { - Q_Q(const QMenuBar); - QList<QAction*> items = q->actions(); - for(int i = 0; i < items.size(); ++i) { - if(actionRect(items.at(i)).contains(p)) - return items.at(i); + for(int i = 0; i < actions.size(); ++i) { + if(actionRect(actions.at(i)).contains(p)) + return actions.at(i); } return 0; } @@ -259,9 +257,9 @@ void QMenuBarPrivate::updateGeometries() } q->updateGeometry(); #ifdef QT3_SUPPORT - if (q->parentWidget() != 0) { + if (parent) { QMenubarUpdatedEvent menubarUpdated(q); - QApplication::sendEvent(q->parentWidget(), &menubarUpdated); + QApplication::sendEvent(parent, &menubarUpdated); } #endif } @@ -413,15 +411,14 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start, QMap<QAction*, Q actionList.clear(); const int itemSpacing = q->style()->pixelMetric(QStyle::PM_MenuBarItemSpacing, 0, q); int max_item_height = 0, separator = -1, separator_start = 0, separator_len = 0; - QList<QAction*> items = q->actions(); //calculate size const QFontMetrics fm = q->fontMetrics(); const int hmargin = q->style()->pixelMetric(QStyle::PM_MenuBarHMargin, 0, q), vmargin = q->style()->pixelMetric(QStyle::PM_MenuBarVMargin, 0, q), icone = q->style()->pixelMetric(QStyle::PM_SmallIconSize, 0, q); - for(int i = 0; i < items.count(); i++) { - QAction *action = items.at(i); + for(int i = 0; i < actions.count(); i++) { + QAction *action = actions.at(i); if(!action->isVisible()) continue; @@ -534,7 +531,6 @@ void QMenuBarPrivate::_q_actionHovered() emit q->hovered(action); #ifndef QT_NO_ACCESSIBILITY if (QAccessible::isActive()) { - QList<QAction*> actions = q->actions(); int actionIndex = actions.indexOf(action); ++actionIndex; QAccessible::updateAccessibility(q, actionIndex, QAccessible::Focus); |