diff options
Diffstat (limited to 'tests/auto/qtooltip/tst_qtooltip.cpp')
-rw-r--r-- | tests/auto/qtooltip/tst_qtooltip.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qtooltip/tst_qtooltip.cpp b/tests/auto/qtooltip/tst_qtooltip.cpp index 283effa..fc76069 100644 --- a/tests/auto/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/qtooltip/tst_qtooltip.cpp @@ -66,6 +66,7 @@ private slots: // task-specific tests below me void task183679_data(); void task183679(); + void whatsThis(); void setPalette(); }; @@ -131,6 +132,27 @@ void tst_QToolTip::task183679() QCOMPARE(QToolTip::isVisible(), visible); } +#include <QWhatsThis> + +void tst_QToolTip::whatsThis() +{ + qApp->setStyleSheet( "QWidget { font-size: 72px; }" ); + QWhatsThis::showText(QPoint(0,0), "THis is text"); + QTest::qWait(400); + QWidget *whatsthis = 0; + foreach (QWidget *widget, QApplication::topLevelWidgets()) { + if (widget->inherits("QWhatsThat")) { + whatsthis = widget; + break; + } + } + QVERIFY(whatsthis); + QVERIFY(whatsthis->isVisible()); + QVERIFY(whatsthis->height() > 100); // Test QTBUG-2416 + qApp->setStyleSheet(""); +} + + void tst_QToolTip::setPalette() { //the previous test may still have a tooltip pending for deletion |