diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-10 10:54:53 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-10 10:55:33 (GMT) |
commit | 8179a9e2cd52b24c70b194106dd170ed1bb677e4 (patch) | |
tree | 7284c59d7a89ab54612a4bc098a8929050c3e184 /src/gui/widgets/qmenubar.cpp | |
parent | f2c4d2fe8a846cfce457512ef1806a7276745590 (diff) | |
download | Qt-8179a9e2cd52b24c70b194106dd170ed1bb677e4.zip Qt-8179a9e2cd52b24c70b194106dd170ed1bb677e4.tar.gz Qt-8179a9e2cd52b24c70b194106dd170ed1bb677e4.tar.bz2 |
small code cleanup that improves some loops
it uses les foreach
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index cffc3d5..fc7e901 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -220,7 +220,8 @@ void QMenuBarPrivate::updateGeometries() //we try to see if the actions will fit there bool hasHiddenActions = false; - foreach(QAction *action, actionList) { + for (int i = 0; i < actionList.count(); ++i) { + QAction *action = actionList.at(i); if (!menuRect.contains(actionRect(action))) { hasHiddenActions = true; break; @@ -230,7 +231,8 @@ void QMenuBarPrivate::updateGeometries() //...and if not, determine the ones that fit on the menu with the extension visible if (hasHiddenActions) { menuRect = this->menuRect(true); - foreach(QAction *action, actionList) { + for (int i = 0; i < actionList.count(); ++i) { + QAction *action = actionList.at(i); if (!menuRect.contains(actionRect(action))) { hiddenActions.append(action); } |