diff options
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index a9fa9bc..4cf9e8f 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9154,38 +9154,38 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { - QWidget main; + QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs + QWidget main(0,0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; palette.setColor(QPalette::Window, Qt::red); main.setPalette(palette); + QDesktopWidget desktop; QRect desktopDimensions = desktop.availableGeometry(&main); - main.setGeometry(desktopDimensions); + QSize mainSize(400, 400); + mainSize = mainSize.boundedTo(desktopDimensions.size()); + main.resize(mainSize); QWidget *offsetWidget = new QWidget(&main); - offsetWidget->setGeometry(0, -14600, desktopDimensions.width(), 15000); + offsetWidget->setGeometry(0, -(15000 - mainSize.height()), mainSize.width(), 15000); // big widget is too big for the coordinates, it must be limited by wrect // if wrect is not at the right position because of offsetWidget, bigwidget // is not painted correctly QWidget *bigWidget = new QWidget(offsetWidget); - - bigWidget->setGeometry(0, 0, desktopDimensions.width(), 50000); + bigWidget->setGeometry(0, 0, mainSize.width(), 50000); palette.setColor(QPalette::Window, Qt::green); bigWidget->setPalette(palette); bigWidget->setAutoFillBackground(true); main.show(); QTest::qWaitForWindowShown(&main); - QTest::qWait(50); - QCursor::setPos(main.pos()); //get the cursor out of the picture - QTest::qWait(50); QPixmap correct(main.size()); correct.fill(Qt::green); - QRect center(desktopDimensions.width()/4,desktopDimensions.width()/4, desktopDimensions.width()/2, desktopDimensions.width()/2); // to avoid the decorations - QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage().copy(center), correct.toImage().copy(center)); + QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage(), correct.toImage()); + QApplication::restoreOverrideCursor(); } void tst_QWidget::inputFocus_task257832() |