diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:28:49 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-10-20 08:28:49 (GMT) |
commit | 1a11cc88e8516097e73d7aefc44c9a97ea0b5aef (patch) | |
tree | 0d1e57ee49db51982083f1fbdba19f5f852f9bf4 /tests/auto/qwidget | |
parent | eeac9aa8d51b11f3040dcf818cec0a58cd0898f0 (diff) | |
parent | 93550050f4fe4f411bfbd80d7b30ff5bc8a20df7 (diff) | |
download | Qt-1a11cc88e8516097e73d7aefc44c9a97ea0b5aef.zip Qt-1a11cc88e8516097e73d7aefc44c9a97ea0b5aef.tar.gz Qt-1a11cc88e8516097e73d7aefc44c9a97ea0b5aef.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 1b898f4..a03f112 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -69,6 +69,9 @@ #include <QtGui/qpaintengine.h> #include <private/qbackingstore_p.h> +#include <QtGui/QGraphicsView> +#include <QtGui/QGraphicsProxyWidget> + #include "../../shared/util.h" @@ -290,6 +293,7 @@ private slots: #ifdef Q_WS_X11 void minAndMaxSizeWithX11BypassWindowManagerHint(); void showHideShow(); + void clean_qt_x11_enforce_cursor(); #endif void compatibilityChildInsertedEvents(); @@ -6194,6 +6198,35 @@ void tst_QWidget::showHideShow() QVERIFY(w.gotExpectedMapNotify); } + +void tst_QWidget::clean_qt_x11_enforce_cursor() +{ + { + QWidget window; + QWidget *w = new QWidget(&window); + QWidget *child = new QWidget(w); + child->setAttribute(Qt::WA_SetCursor, true); + + window.show(); + QApplication::setActiveWindow(&window); + QTest::qWaitForWindowShown(&window); + QTest::qWait(100); + QCursor::setPos(window.geometry().center()); + QTest::qWait(100); + + child->setFocus(); + QApplication::processEvents(); + QTest::qWait(100); + + delete w; + } + + QGraphicsScene scene; + QLineEdit *edit = new QLineEdit; + scene.addWidget(edit); + + // If the test didn't crash, then it passed. +} #endif class EventRecorder : public QObject @@ -7605,11 +7638,11 @@ void tst_QWidget::updateWhileMinimized() QTest::qWaitForWindowShown(&widget); QApplication::processEvents(); QTRY_VERIFY(widget.numPaintEvents > 0); - QTest::qWait(50); + QTest::qWait(150); // Minimize window. widget.showMinimized(); - QTest::qWait(70); + QTest::qWait(110); widget.reset(); @@ -8310,7 +8343,7 @@ public: static bool firstTime = true; if (firstTime) - QTimer::singleShot(150, this, SLOT(resizeMe())); + QTimer::singleShot(250, this, SLOT(resizeMe())); firstTime = false; } @@ -8327,7 +8360,7 @@ void tst_QWidget::moveInResizeEvent() testWidget.setGeometry(50, 50, 200, 200); testWidget.show(); QTest::qWaitForWindowShown(&testWidget); - QTest::qWait(160); + QTest::qWait(300); QRect expectedGeometry(100,100, 100, 100); QTRY_COMPARE(testWidget.geometry(), expectedGeometry); |