106 void isSeparator(); |
106 void isSeparator(); |
107 void setCursor(); |
107 void setCursor(); |
108 void addToolbarAfterShow(); |
108 void addToolbarAfterShow(); |
109 void centralWidgetSize(); |
109 void centralWidgetSize(); |
110 void dockWidgetSize(); |
110 void dockWidgetSize(); |
|
111 void QTBUG2774_stylechange(); |
111 }; |
112 }; |
112 |
113 |
113 // Testing get/set functions |
114 // Testing get/set functions |
114 void tst_QMainWindow::getSetCheck() |
115 void tst_QMainWindow::getSetCheck() |
115 { |
116 { |
1707 } else { |
1708 } else { |
1708 //otherwise the screen is too small and the size are irrelevant |
1709 //otherwise the screen is too small and the size are irrelevant |
1709 } |
1710 } |
1710 } |
1711 } |
1711 |
1712 |
|
1713 void tst_QMainWindow::QTBUG2774_stylechange() |
|
1714 { |
|
1715 |
|
1716 QMainWindow mw; |
|
1717 QDockWidget *dockw = new QDockWidget(); |
|
1718 mw.addDockWidget(Qt::LeftDockWidgetArea, dockw); |
|
1719 mw.addDockWidget(Qt::LeftDockWidgetArea, new QDockWidget()); |
|
1720 QTextEdit *central = new QTextEdit(&mw); |
|
1721 mw.setCentralWidget(central); |
|
1722 dockw->resize(10,10); |
|
1723 mw.show(); |
|
1724 QTest::qWaitForWindowShown(&mw); |
|
1725 int centralOriginalWidth = central->width(); |
|
1726 |
|
1727 QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() - 3))); |
|
1728 QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); |
|
1729 QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 30))); |
|
1730 |
|
1731 |
|
1732 { |
|
1733 QTest::qWait(1000); |
|
1734 mw.setStyleSheet("QMainWindow::separator { width: 50px; height:50px; }"); |
|
1735 QTest::qWait(5000); |
|
1736 QApplication::processEvents(); |
|
1737 QVERIFY(central->width() < centralOriginalWidth); |
|
1738 QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); |
|
1739 QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 49))); |
|
1740 } |
|
1741 |
|
1742 { |
|
1743 mw.setStyleSheet("QMainWindow::separator { width: 0px; height: 0px; }"); |
|
1744 QApplication::processEvents(); |
|
1745 QVERIFY(central->width() > centralOriginalWidth); |
|
1746 QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); |
|
1747 QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 1))); |
|
1748 } |
|
1749 } |
|
1750 |
|
1751 |
1712 |
1752 |
1713 QTEST_MAIN(tst_QMainWindow) |
1753 QTEST_MAIN(tst_QMainWindow) |
1714 #include "tst_qmainwindow.moc" |
1754 #include "tst_qmainwindow.moc" |