summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-04-27 08:45:30 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-04-27 08:45:30 (GMT)
commit9cea45515ef283c9a870c6f515da50d31addafcf (patch)
treed14fdf2b17a2a52c90ac514c39ad60be200cc7d7 /src/gui/widgets
parent6749edd4c6f647c4963793183a452bb1ae769c1c (diff)
parent13dff164d2ab13b1258d31693b67acebc8636890 (diff)
downloadQt-9cea45515ef283c9a870c6f515da50d31addafcf.zip
Qt-9cea45515ef283c9a870c6f515da50d31addafcf.tar.gz
Qt-9cea45515ef283c9a870c6f515da50d31addafcf.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qtabbar.cpp15
-rw-r--r--src/gui/widgets/qtabbar_p.h2
2 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 7559311..d03a2f4 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -580,16 +580,10 @@ void QTabBarPrivate::layoutTab(int index)
}
}
-void QTabBarPrivate::layoutWidgets(int index)
+void QTabBarPrivate::layoutWidgets(int start)
{
Q_Q(QTabBar);
- int start = 0;
- int end = q->count();
- if (index != -1) {
- start = qMax(index, 0);
- end = qMin(end, start + 1);
- }
- for (int i = start; i < end; ++i) {
+ for (int i = start; i < q->count(); ++i) {
layoutTab(i);
}
}
@@ -1171,8 +1165,9 @@ void QTabBar::setCurrentIndex(int index)
update();
d->makeVisible(index);
d->tabList[index].lastTab = oldIndex;
- d->layoutWidgets(oldIndex);
- d->layoutWidgets(index);
+ if (oldIndex >= 0 && oldIndex < count())
+ d->layoutTab(oldIndex);
+ d->layoutTab(index);
#ifdef QT3_SUPPORT
emit selected(index);
#endif
diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h
index 83636e6..37741f7 100644
--- a/src/gui/widgets/qtabbar_p.h
+++ b/src/gui/widgets/qtabbar_p.h
@@ -178,7 +178,7 @@ public:
void refresh();
void layoutTabs();
- void layoutWidgets(int index = -1);
+ void layoutWidgets(int start = 0);
void layoutTab(int index);
void updateMacBorderMetrics();
void setupMovableTab();