summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-10 10:54:53 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-10 10:55:33 (GMT)
commit8179a9e2cd52b24c70b194106dd170ed1bb677e4 (patch)
tree7284c59d7a89ab54612a4bc098a8929050c3e184 /src/gui/widgets
parentf2c4d2fe8a846cfce457512ef1806a7276745590 (diff)
downloadQt-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')
-rw-r--r--src/gui/widgets/qdockarealayout.cpp8
-rw-r--r--src/gui/widgets/qdockwidget.cpp7
-rw-r--r--src/gui/widgets/qmenubar.cpp6
3 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index 4f0ec1e..58e8f9c 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -2202,8 +2202,8 @@ QSet<QWidget*> QDockAreaLayoutInfo::usedSeparatorWidgets() const
{
QSet<QWidget*> result;
- foreach (QWidget *sepWidget, separatorWidgets)
- result << sepWidget;
+ for (int i = 0; i < separatorWidgets.count(); ++i)
+ result << separatorWidgets.at(i);
for (int i = 0; i < item_list.count(); ++i) {
const QDockAreaLayoutItem &item = item_list.at(i);
@@ -3244,8 +3244,8 @@ QSet<QWidget*> QDockAreaLayout::usedSeparatorWidgets() const
{
QSet<QWidget*> result;
- foreach (QWidget *sepWidget, separatorWidgets)
- result << sepWidget;
+ for (int i = 0; i < separatorWidgets.count(); ++i)
+ result << separatorWidgets.at(i);
for (int i = 0; i < QInternal::DockCount; ++i) {
const QDockAreaLayoutInfo &dock = docks[i];
result += dock.usedSeparatorWidgets();
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index d573b8b..6a0c879 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -221,7 +221,8 @@ void QDockWidgetLayout::addItem(QLayoutItem*)
QLayoutItem *QDockWidgetLayout::itemAt(int index) const
{
int cnt = 0;
- foreach (QLayoutItem *item, item_list) {
+ for (int i = 0; i < item_list.count(); ++i) {
+ QLayoutItem *item = item_list.at(i);
if (item == 0)
continue;
if (index == cnt++)
@@ -250,8 +251,8 @@ QLayoutItem *QDockWidgetLayout::takeAt(int index)
int QDockWidgetLayout::count() const
{
int result = 0;
- foreach (QLayoutItem *item, item_list) {
- if (item != 0)
+ for (int i = 0; i < item_list.count(); ++i) {
+ if (item_list.at(i))
++result;
}
return result;
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);
}