summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstylesheetstyle
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-03 20:21:08 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-03 22:08:55 +0200
commit437b4f6d44beeb48679da86a0a8eb825ba86c7db (patch)
tree9abcb560ea128cbc33618525918e9d556aa7719a /tests/auto/qstylesheetstyle
parent65d4bca69eeceef7af247f3683f8844e07fce771 (diff)
QStyleSheetStyle test: test that the widget loose their style when they are not hovered
Diffstat (limited to 'tests/auto/qstylesheetstyle')
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 4c8f68958e..55b6e96b46 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -845,6 +845,7 @@ void tst_QStyleSheetStyle::hoverColors()
#endif
QApplication::setActiveWindow(&frame);
QTest::qWait(60);
+ //move the mouse inside the widget, it should be colored
QTest::mouseMove ( widget, QPoint(5,5));
QTest::qWait(60);
@@ -857,6 +858,32 @@ void tst_QStyleSheetStyle::hoverColors()
QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)),
(QString::fromLatin1(widget->metaObject()->className())
+ " did not contain text color #ff0084").toLocal8Bit().constData());
+
+ //move the mouse outside the widget, it should NOT be colored
+ QTest::mouseMove ( dummy, QPoint(5,5));
+ QTest::qWait(60);
+
+ frame.render(&image);
+
+ QVERIFY2(!testForColors(image, QColor(0xe8, 0xff, 0x66)),
+ (QString::fromLatin1(widget->metaObject()->className())
+ + " did contain background color #e8ff66").toLocal8Bit().constData());
+ QVERIFY2(!testForColors(image, QColor(0xff, 0x00, 0x84)),
+ (QString::fromLatin1(widget->metaObject()->className())
+ + " did contain text color #ff0084").toLocal8Bit().constData());
+
+ //move the mouse again inside the widget, it should be colored
+ QTest::mouseMove (widget, QPoint(5,5));
+ QTest::qWait(60);
+
+ frame.render(&image);
+
+ QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)),
+ (QString::fromLatin1(widget->metaObject()->className())
+ + " did not contain background color #e8ff66").toLocal8Bit().constData());
+ QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)),
+ (QString::fromLatin1(widget->metaObject()->className())
+ + " did not contain text color #ff0084").toLocal8Bit().constData());
}
}