diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-03 18:21:08 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-03 20:08:55 (GMT) |
commit | 437b4f6d44beeb48679da86a0a8eb825ba86c7db (patch) | |
tree | 9abcb560ea128cbc33618525918e9d556aa7719a /tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp | |
parent | 65d4bca69eeceef7af247f3683f8844e07fce771 (diff) | |
download | Qt-437b4f6d44beeb48679da86a0a8eb825ba86c7db.zip Qt-437b4f6d44beeb48679da86a0a8eb825ba86c7db.tar.gz Qt-437b4f6d44beeb48679da86a0a8eb825ba86c7db.tar.bz2 |
QStyleSheetStyle test: test that the widget loose their style when they are not hovered
Diffstat (limited to 'tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp')
-rw-r--r-- | tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp index 4c8f689..55b6e96 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()); } } |