summaryrefslogtreecommitdiff
path: root/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-09 10:09:39 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-09 10:10:44 +0200
commit2cbc5ee1bc89be2f174566f35eb89b493ba75c69 (patch)
treefb58bf31671b33860ea93042b11392df7fcc5b01 /tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
parentd71d5ffd356342e55f09b31f5a702926f86994eb (diff)
downloadqt4-tools-2cbc5ee1bc89be2f174566f35eb89b493ba75c69.tar.gz
Make the QGraphicsViews more rebost regarding slow window manager
Diffstat (limited to 'tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 8bac29d4fb..9249f6dcc0 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -51,7 +51,6 @@
#include <private/qt_x11_p.h>
#endif
-
static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton)
{
QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0);
@@ -953,6 +952,8 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
+ //do not let the window manager move the window while we are moving the mouse on it
+ view.setWindowFlags(Qt::X11BypassWindowManagerHint);
view.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
@@ -975,7 +976,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
// in
QTest::mouseMove(&view, QPoint(50, 50));
QTest::qWait(250);
- // QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget ? true : false);
+ QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget ? true : false);
// ### this attribute isn't supported
QCOMPARE(widget->enterCount, hasWidget ? 1 : 0);
QCOMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0);
@@ -1288,7 +1289,7 @@ void tst_QGraphicsProxyWidget::paintEvent()
w->update();
QTest::qWait(100);
- QCOMPARE(proxy.paintCount, 1); //the widget should have been painted now
+ QTRY_COMPARE(proxy.paintCount, 1); //the widget should have been painted now
}
@@ -1481,8 +1482,8 @@ void tst_QGraphicsProxyWidget::scrollUpdate()
view.paintEventRegion = QRegion();
view.npaints = 0;
QTimer::singleShot(0, widget, SLOT(updateScroll()));
- QTest::qWait(500);
- QCOMPARE(view.npaints, 2);
+ QTest::qWait(50);
+ QTRY_COMPARE(view.npaints, 2);
// QRect(0, 0, 200, 12) is the first update, expanded (-2, -2, 2, 2)
// QRect(0, 12, 102, 10) is the scroll update, expanded (-2, -2, 2, 2),
// intersected with the above update.