summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-14 15:46:44 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-14 15:46:44 (GMT)
commit591131dca30622a2f7cd8e994a826384115edc84 (patch)
tree1e89d1047ae3809d328743de2961c840f39561dd /tests
parent5de30ecf4c28279fe8eed0ed8cb53504eb1350d7 (diff)
parent65e0fe383bba7b75e3ff5f8dd1bf3bb61a8bc589 (diff)
downloadQt-591131dca30622a2f7cd8e994a826384115edc84.zip
Qt-591131dca30622a2f7cd8e994a826384115edc84.tar.gz
Qt-591131dca30622a2f7cd8e994a826384115edc84.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging: Merge request: 1111 Doc: inform better about how you can tweak Qt apps on Mac Mac: add support for closing dialogs using Cmd-D Cocoa: use mouse location from event Cocoa: implement eventdispatcher flag excludeUserInputEvents Cocoa: processEvents does not always send posted events Added QMdiArea::tabsMovable and tabsClosable Enable the widthForHeight() test case. Fix some wrong tests in heightForWidth() Fix and enable the tests that were disabled. Fixed a double selection in QFileDialog when saving fix qFadeEffect windowOpacity issue on Windows Cleanup unused QAccessWidget Fixed a problem with toolbars not relayouting Compile fix on solaris Autotest illustrating Qt::InitialSortOrderRole Mention when the role was introduced Add a way to set QHeaderView initial sort order Doc: Fixing typo
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp112
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp37
-rw-r--r--tests/auto/qmdiarea/tst_qmdiarea.cpp73
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp2
4 files changed, 166 insertions, 58 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index bac17b1..837df78 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -2541,7 +2541,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 0, 50,10) << QRectF(50, 0, 50,10)
<< QRectF(0, 10, 50,100) << QRectF(50, 10, 50,400)
);
-#if 0
+
QTest::newRow("hfw-100x470") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
@@ -2556,9 +2556,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(500, 500))
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(500,500))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 470)
@@ -2567,7 +2567,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 70, 50,100) << QRectF(50, 70, 50,400)
);
-
// change layout width and verify
QTest::newRow("hfw-100x401") << (ItemList()
<< ItemDesc(0,0)
@@ -2583,9 +2582,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
+ .minSize(QSizeF(-1,-1))
+ .preferredSize(QSizeF(-1,-1))
+ .maxSize(QSizeF(-1, -1))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(100, 401)
@@ -2594,7 +2593,7 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF( 0, 1, 50, 100) << QRectF( 50, 1, 50, 400)
);
- QTest::newRow("hfw-160x400") << (ItemList()
+ QTest::newRow("hfw-160x350") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
.preferredSize(QSizeF(50,10))
@@ -2608,18 +2607,17 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
- .dynamicConstraint(hfw1, Qt::Vertical)
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000,5000))
+ .dynamicConstraint(hfw1, Qt::Vertical)
)
- << QSizeF(160, 400)
+ << QSizeF(160, 350)
<< (RectList()
<< QRectF( 0, 0, 80, 100) << QRectF( 80, 0, 80, 100)
<< QRectF( 0, 100, 80, 100) << QRectF( 80, 100, 80, 250)
);
-
QTest::newRow("hfw-160x300") << (ItemList()
<< ItemDesc(0,0)
.minSize(QSizeF(1,1))
@@ -2634,9 +2632,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,10))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(40,40))
- .preferredSize(QSizeF(50,400))
- .maxSize(QSizeF(5000, 5000))
+ .sizeHint(Qt::MinimumSize, QSizeF(40,40))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,400))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000, 5000))
.dynamicConstraint(hfw1, Qt::Vertical)
)
<< QSizeF(160, 300)
@@ -2647,11 +2645,11 @@ void tst_QGraphicsGridLayout::geometries_data()
QTest::newRow("hfw-20x40") << (ItemList()
<< ItemDesc(0,0)
- .minSize(QSizeF(1,1))
+ .minSize(QSizeF(1,10))
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(0,1)
- .minSize(QSizeF(1,10))
+ .minSize(QSizeF(1,1))
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,0)
@@ -2659,9 +2657,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1, 1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50, 50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(hfw3, Qt::Vertical)
)
<< QSizeF(20, 40)
@@ -2684,9 +2682,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(10,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(10,10))
- .preferredSize(QSizeF(400,50))
- .maxSize(QSizeF(5000, 5000))
+ .sizeHint(Qt::MinimumSize, QSizeF(10,10))
+ .sizeHint(Qt::PreferredSize, QSizeF(400,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(5000, 5000))
.dynamicConstraint(wfh1, Qt::Horizontal)
)
<< QSizeF(300, 160)
@@ -2711,9 +2709,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
<< QSizeF(40, 20)
@@ -2736,9 +2734,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(50,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(50,50))
- .maxSize(QSizeF(100, 100))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(50,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(100, 100))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
@@ -2767,9 +2765,9 @@ void tst_QGraphicsGridLayout::geometries_data()
.preferredSize(QSizeF(10,50))
.maxSize(QSizeF(100, 100))
<< ItemDesc(1,1)
- .minSize(QSizeF(1,1))
- .preferredSize(QSizeF(10,50))
- .maxSize(QSizeF(500, 500))
+ .sizeHint(Qt::MinimumSize, QSizeF(1,1))
+ .sizeHint(Qt::PreferredSize, QSizeF(10,50))
+ .sizeHint(Qt::MaximumSize, QSizeF(500, 500))
.dynamicConstraint(wfh2, Qt::Horizontal)
)
<< QSizeF(160, 100)
@@ -2777,7 +2775,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 0, 80, 50) << QRectF( 80, 0, 80, 50)
<< QRectF(0, 50, 80, 50) << QRectF( 80, 50, 50, 50)
);
-#endif
QTest::newRow("hfw-h470") << (ItemList()
<< ItemDesc(0,0)
@@ -2804,7 +2801,6 @@ void tst_QGraphicsGridLayout::geometries_data()
<< QRectF(0, 70, 50,100) << QRectF(50, 70, 50,400)
);
-
// change layout width and verify
QTest::newRow("hfw-w100") << (ItemList()
<< ItemDesc(0,0)
@@ -3069,25 +3065,24 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->setSpacing(0);
RectWidget *w00 = new RectWidget;
w00->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w00->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w00->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w00->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w00, 0, 0);
RectWidget *w01 = new RectWidget;
w01->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w01->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w01->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w01->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w01, 0, 1);
RectWidget *w10 = new RectWidget;
w10->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w10->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w10->setSizeHint(Qt::PreferredSize, QSizeF(10,10));
w10->setSizeHint(Qt::MaximumSize, QSizeF(100,100));
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
- w11->setSizeHint(Qt::PreferredSize, QSizeF(50,400));
w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
w11->setConstraintFunction(hfw);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -3096,34 +3091,37 @@ void tst_QGraphicsGridLayout::heightForWidth()
layout->addItem(w11, 1, 1);
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, -1)), QSizeF(2, 2));
- QEXPECT_FAIL("", "QTBUG-14693", Continue);
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, -1)), QSizeF(210, 110));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, -1)), QSizeF(30100, 30100));
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(2, -1)), QSizeF(2, 20001));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20050));
+ QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(2, -1)), QSizeF(2, 20010));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(2, -1)), QSizeF(2, 20100));
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1)), QSizeF(20, 1 + 2000));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1)), QSizeF(20, 50 + 2000));
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1)), QSizeF(20, 100 + 2000));
+ // Since 20 is somewhere between "minimum width hint" (2) and
+ // "preferred width hint" (210), it will try to do distribution by
+ // stretching them with different factors.
+ // Since column 1 has a "preferred width" of 200 it means that
+ // column 1 will be a bit wider than column 0. Thus it will also be a bit
+ // shorter than 2001, (the expected height if all columns had width=10)
+ QSizeF sh = layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(20, -1));
+ // column 1 cannot be wider than 19, which means that it must be taller than 20000/19~=1052
+ QVERIFY(sh.height() < 2000 + 1 && sh.height() > 1052 + 1);
+
+ sh = layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(20, -1));
+ QVERIFY(sh.height() < 2000 + 10 && sh.height() > 1052 + 10);
- QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(300, -1)), QSizeF(300, 1 + 100));
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(300, -1)), QSizeF(300, 50 + 100));
- QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(300, -1)), QSizeF(300, 100 + 100));
+ sh = layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(20, -1));
+ QVERIFY(sh.height() < 2000 + 100 && sh.height() > 1052 + 100);
// the height of the hfw widget is shorter than the one to the left, which is 100, so
// the total height of the last row is 100 (which leaves the layout height to be 200)
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(500, -1)), QSizeF(500, 100 + 100));
- // hfw item size: (500, 40) -> preferred size is maxed up to preferred size of item w10 (50)
- QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(600, -1)), QSizeF(600, 50 + 50));
-
}
void tst_QGraphicsGridLayout::widthForHeight()
{
-#if 0
QGraphicsWidget *widget = new QGraphicsWidget;
QGraphicsGridLayout *layout = new QGraphicsGridLayout;
widget->setLayout(layout);
@@ -3150,9 +3148,10 @@ void tst_QGraphicsGridLayout::widthForHeight()
layout->addItem(w10, 1, 0);
RectWidget *w11 = new RectWidget;
- w11->setMinimumSize(1,1);
- w11->setPreferredSize(50, 50);
- w11->setMaximumSize(30000,30000);
+ w11->setSizeHint(Qt::MinimumSize, QSizeF(1,1));
+ w11->setSizeHint(Qt::PreferredSize, QSizeF(50,50));
+ w11->setSizeHint(Qt::MaximumSize, QSizeF(30000,30000));
+
// This will make sure its always square.
w11->setConstraintFunction(wfh);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -3196,7 +3195,6 @@ void tst_QGraphicsGridLayout::widthForHeight()
QCOMPARE(layout->effectiveSizeHint(Qt::MinimumSize, QSizeF(-1, 300)), QSizeF(1 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, 300)), QSizeF(50 + 200, 300));
QCOMPARE(layout->effectiveSizeHint(Qt::MaximumSize, QSizeF(-1, 300)), QSizeF(100 + 200, 300));
-#endif
}
void tst_QGraphicsGridLayout::heightForWidthWithSpanning()
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index db71e39..9a25fb6 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -195,6 +195,8 @@ private slots:
void QTBUG8650_crashOnInsertSections();
void QTBUG12268_hiddenMovedSectionSorting();
+ void initialSortOrderRole();
+
protected:
QWidget *topLevel;
QHeaderView *view;
@@ -2097,5 +2099,40 @@ void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting()
QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
}
+void tst_QHeaderView::initialSortOrderRole()
+{
+ QTableView view;
+ QStandardItemModel *model = new QStandardItemModel(4, 3, &view);
+ for (int i = 0; i< model->rowCount(); ++i)
+ for (int j = 0; j< model->columnCount(); ++j)
+ model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j));
+ QStandardItem *ascendingItem = new QStandardItem();
+ QStandardItem *descendingItem = new QStandardItem();
+ ascendingItem->setData(Qt::AscendingOrder, Qt::InitialSortOrderRole);
+ descendingItem->setData(Qt::DescendingOrder, Qt::InitialSortOrderRole);
+ model->setHorizontalHeaderItem(1, ascendingItem);
+ model->setHorizontalHeaderItem(2, descendingItem);
+ view.setModel(model);
+ view.setSortingEnabled(true);
+ view.sortByColumn(0, Qt::AscendingOrder);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ const int column1Pos = view.horizontalHeader()->sectionViewportPosition(1) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column1Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 1);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder);
+
+ const int column2Pos = view.horizontalHeader()->sectionViewportPosition(2) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column2Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 2);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::DescendingOrder);
+
+ const int column0Pos = view.horizontalHeader()->sectionViewportPosition(0) + 5; // +5 not to be on the handle
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(column0Pos, 0));
+ QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), 0);
+ QCOMPARE(view.horizontalHeader()->sortIndicatorOrder(), Qt::AscendingOrder);
+}
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"
diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp
index d44e632..67d3d0d 100644
--- a/tests/auto/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp
@@ -287,6 +287,8 @@ private slots:
void setActivationOrder();
void tabBetweenSubWindows();
void setViewMode();
+ void setTabsClosable();
+ void setTabsMovable();
void setTabShape();
void setTabPosition_data();
void setTabPosition();
@@ -2464,6 +2466,77 @@ void tst_QMdiArea::setViewMode()
QCOMPARE(mdiArea.viewMode(), QMdiArea::SubWindowView);
}
+void tst_QMdiArea::setTabsClosable()
+{
+ QMdiArea mdiArea;
+ mdiArea.addSubWindow(new QWidget);
+
+ // test default
+ QCOMPARE(mdiArea.tabsClosable(), false);
+
+ // change value before tab bar exists
+ QTabBar *tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(!tabBar);
+ mdiArea.setTabsClosable(true);
+ QCOMPARE(mdiArea.tabsClosable(), true);
+
+ // force tab bar creation
+ mdiArea.setViewMode(QMdiArea::TabbedView);
+ tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(tabBar);
+
+ // value must've been propagated
+ QCOMPARE(tabBar->tabsClosable(), true);
+
+ // change value when tab bar exists
+ mdiArea.setTabsClosable(false);
+ QCOMPARE(mdiArea.tabsClosable(), false);
+ QCOMPARE(tabBar->tabsClosable(), false);
+}
+
+void tst_QMdiArea::setTabsMovable()
+{
+ QMdiArea mdiArea;
+ QMdiSubWindow *subWindow1 = mdiArea.addSubWindow(new QWidget);
+ QMdiSubWindow *subWindow2 = mdiArea.addSubWindow(new QWidget);
+ QMdiSubWindow *subWindow3 = mdiArea.addSubWindow(new QWidget);
+
+ // test default
+ QCOMPARE(mdiArea.tabsMovable(), false);
+
+ // change value before tab bar exists
+ QTabBar *tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(!tabBar);
+ mdiArea.setTabsMovable(true);
+ QCOMPARE(mdiArea.tabsMovable(), true);
+
+ // force tab bar creation
+ mdiArea.setViewMode(QMdiArea::TabbedView);
+ tabBar = qFindChild<QTabBar *>(&mdiArea);
+ QVERIFY(tabBar);
+
+ // value must've been propagated
+ QCOMPARE(tabBar->isMovable(), true);
+
+ // test tab moving
+ QList<QMdiSubWindow *> subWindows;
+ subWindows << subWindow1 << subWindow2 << subWindow3;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+ tabBar->moveTab(1, 2); // 1,3,2
+ subWindows.clear();
+ subWindows << subWindow1 << subWindow3 << subWindow2;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+ tabBar->moveTab(0, 2); // 3,2,1
+ subWindows.clear();
+ subWindows << subWindow3 << subWindow2 << subWindow1;
+ QCOMPARE(mdiArea.subWindowList(QMdiArea::CreationOrder), subWindows);
+
+ // change value when tab bar exists
+ mdiArea.setTabsMovable(false);
+ QCOMPARE(mdiArea.tabsMovable(), false);
+ QCOMPARE(tabBar->isMovable(), false);
+}
+
void tst_QMdiArea::setTabShape()
{
QMdiArea mdiArea;
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 2208bea..35014c9 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -10576,7 +10576,7 @@ void tst_QWidget::nativeChildFocus()
QTest::qWaitForWindowShown(&w);
QCOMPARE(QApplication::activeWindow(), &w);
- QCOMPARE(QApplication::focusWidget(), p1);
+ QCOMPARE(QApplication::focusWidget(), static_cast<QWidget*>(p1));
}
QTEST_MAIN(tst_QWidget)