diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-05-12 12:11:55 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-05-12 12:11:55 (GMT) |
commit | f5ac9ac1387fb9aac7c74d686f0b247ac50746e1 (patch) | |
tree | 8efb9b6c1029f8b9c26b96fa5389b1b0623c5163 /tests/auto/qtabbar/tst_qtabbar.cpp | |
parent | cb369071fa9b15e68f91d2883ee29f12c58fc803 (diff) | |
parent | bc184432c49eb56254bc5db07c6af03718c6b0e7 (diff) | |
download | Qt-f5ac9ac1387fb9aac7c74d686f0b247ac50746e1.zip Qt-f5ac9ac1387fb9aac7c74d686f0b247ac50746e1.tar.gz Qt-f5ac9ac1387fb9aac7c74d686f0b247ac50746e1.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-animations
Diffstat (limited to 'tests/auto/qtabbar/tst_qtabbar.cpp')
-rw-r--r-- | tests/auto/qtabbar/tst_qtabbar.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp index 433eb86..31722de 100644 --- a/tests/auto/qtabbar/tst_qtabbar.cpp +++ b/tests/auto/qtabbar/tst_qtabbar.cpp @@ -92,6 +92,8 @@ private slots: void moveTab_data(); void moveTab(); + + void task251184_removeTab(); }; // Testing get/set functions @@ -503,5 +505,35 @@ void tst_QTabBar::moveTab() bar.callMoveTab(from, to); } + +class MyTabBar : public QTabBar +{ + Q_OBJECT +public slots: + void onCurrentChanged() + { + //we just want this to be done once + disconnect(this, SIGNAL(currentChanged(int)), this, SLOT(onCurrentChanged())); + removeTab(0); + } +}; + +void tst_QTabBar::task251184_removeTab() +{ + MyTabBar bar; + bar.addTab("bar1"); + bar.addTab("bar2"); + QCOMPARE(bar.count(), 2); + QCOMPARE(bar.currentIndex(), 0); + + bar.connect(&bar, SIGNAL(currentChanged(int)), SLOT(onCurrentChanged())); + bar.setCurrentIndex(1); + + QCOMPARE(bar.count(), 1); + QCOMPARE(bar.currentIndex(), 0); + QCOMPARE(bar.tabText(bar.currentIndex()), QString("bar2")); +} + + QTEST_MAIN(tst_QTabBar) #include "tst_qtabbar.moc" |