summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-23 19:31:20 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-23 19:31:20 (GMT)
commit03ca1537aa8bebda43f3d95b559e5b35372c1d88 (patch)
tree7a9dff1a082b131b505633bbc78f8ef125ae0206 /src/gui/widgets
parent27f96458ba40dcbf5db4df0b0e553ca5799a13c4 (diff)
parent1d127826c96d0f60753cebc038fde2ced28e73d1 (diff)
downloadQt-03ca1537aa8bebda43f3d95b559e5b35372c1d88.zip
Qt-03ca1537aa8bebda43f3d95b559e5b35372c1d88.tar.gz
Qt-03ca1537aa8bebda43f3d95b559e5b35372c1d88.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Avoided O(n^2) behavior in painter path clipper. Optimization: Avoid data copy when reading jpegs from memory QTabBar: Widgets inside the tab bar where not properly laid out after moveTab()
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();