400 |
400 |
401 void focusProxyAndInputMethods(); |
401 void focusProxyAndInputMethods(); |
402 void scrollWithoutBackingStore(); |
402 void scrollWithoutBackingStore(); |
403 |
403 |
404 void taskQTBUG_7532_tabOrderWithFocusProxy(); |
404 void taskQTBUG_7532_tabOrderWithFocusProxy(); |
|
405 void movedAndResizedAttributes(); |
405 |
406 |
406 private: |
407 private: |
407 bool ensureScreenSize(int width, int height); |
408 bool ensureScreenSize(int width, int height); |
408 QWidget *testWidget; |
409 QWidget *testWidget; |
409 }; |
410 }; |
8827 #ifdef Q_WS_X11 |
8828 #ifdef Q_WS_X11 |
8828 qt_x11_wait_for_window_manager(&label); |
8829 qt_x11_wait_for_window_manager(&label); |
8829 #endif |
8830 #endif |
8830 QTest::qWait(200); |
8831 QTest::qWait(200); |
8831 |
8832 |
8832 QPixmap widgetSnapshot = QPixmap::grabWindow(label.winId()); |
8833 QPixmap widgetSnapshot; |
|
8834 |
|
8835 #ifdef Q_WS_WIN |
|
8836 QWidget *desktopWidget = QApplication::desktop()->screen(0); |
|
8837 if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) |
|
8838 widgetSnapshot = QPixmap::grabWindow(desktopWidget->winId(), 0,0, label.width(), label.height()); |
|
8839 else |
|
8840 #endif |
|
8841 widgetSnapshot = QPixmap::grabWindow(label.winId()); |
8833 QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); |
8842 QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); |
8834 QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32); |
8843 QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32); |
8835 QCOMPARE(actual.size(),expected.size()); |
8844 QCOMPARE(actual.size(),expected.size()); |
8836 QCOMPARE(actual,expected); |
8845 QCOMPARE(actual,expected); |
8837 } |
8846 } |
10030 QWidget::setTabOrder(&w, fp); |
10039 QWidget::setTabOrder(&w, fp); |
10031 |
10040 |
10032 // No Q_ASSERT, then it's allright. |
10041 // No Q_ASSERT, then it's allright. |
10033 } |
10042 } |
10034 |
10043 |
|
10044 void tst_QWidget::movedAndResizedAttributes() |
|
10045 { |
|
10046 #if defined (Q_OS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) |
|
10047 QEXPECT_FAIL("", "FixMe, QTBUG-8941 and QTBUG-8977", Abort); |
|
10048 QVERIFY(false); |
|
10049 #else |
|
10050 QWidget w; |
|
10051 w.show(); |
|
10052 |
|
10053 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10054 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10055 |
|
10056 w.setWindowState(Qt::WindowFullScreen); |
|
10057 |
|
10058 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10059 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10060 |
|
10061 w.setWindowState(Qt::WindowMaximized); |
|
10062 |
|
10063 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10064 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10065 |
|
10066 w.setWindowState(Qt::WindowMinimized); |
|
10067 |
|
10068 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10069 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10070 |
|
10071 w.showNormal(); |
|
10072 |
|
10073 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10074 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10075 |
|
10076 w.showMaximized(); |
|
10077 |
|
10078 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10079 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10080 |
|
10081 w.showFullScreen(); |
|
10082 |
|
10083 QVERIFY(!w.testAttribute(Qt::WA_Moved)); |
|
10084 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10085 |
|
10086 w.showNormal(); |
|
10087 w.move(10,10); |
|
10088 QVERIFY(w.testAttribute(Qt::WA_Moved)); |
|
10089 #if defined(Q_OS_WIN) |
|
10090 QEXPECT_FAIL("", "FixMe, QTBUG-8911", Abort); |
|
10091 #endif |
|
10092 QVERIFY(!w.testAttribute(Qt::WA_Resized)); |
|
10093 |
|
10094 w.resize(100, 100); |
|
10095 QVERIFY(w.testAttribute(Qt::WA_Moved)); |
|
10096 QVERIFY(w.testAttribute(Qt::WA_Resized)); |
|
10097 #endif |
|
10098 } |
|
10099 |
10035 QTEST_MAIN(tst_QWidget) |
10100 QTEST_MAIN(tst_QWidget) |
10036 #include "tst_qwidget.moc" |
10101 #include "tst_qwidget.moc" |