diff options
author | Trond Kjernaasen <trond@trolltech.com> | 2009-09-17 13:07:03 (GMT) |
---|---|---|
committer | Trond Kjernaasen <trond@trolltech.com> | 2009-09-17 13:11:00 (GMT) |
commit | deb322f3f358b0e596720f85361a0e7077137530 (patch) | |
tree | b80f96f7172d0dc231b6f65be40cf3e51c0fbe54 /tests/auto/qtooltip | |
parent | d267c0946b65e0c93cb97ebb3dea1035ff390280 (diff) | |
download | Qt-deb322f3f358b0e596720f85361a0e7077137530.zip Qt-deb322f3f358b0e596720f85361a0e7077137530.tar.gz Qt-deb322f3f358b0e596720f85361a0e7077137530.tar.bz2 |
Fixed a bug in QToolTip when internal tool tips where reused.
If a tool tip is to be reused, it *has* to be visible otherwise
it *may* get destroyed by the expiration timer before the timer is reset.
The tst_qtooltip::setPalette() test triggered this obscure bug under
Windows.
Reviewed-by: Kim
Diffstat (limited to 'tests/auto/qtooltip')
-rw-r--r-- | tests/auto/qtooltip/tst_qtooltip.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/qtooltip/tst_qtooltip.cpp b/tests/auto/qtooltip/tst_qtooltip.cpp index 5068460..2ad74a3 100644 --- a/tests/auto/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/qtooltip/tst_qtooltip.cpp @@ -42,6 +42,7 @@ #include <QtTest/QtTest> #include <qtooltip.h> +#include "../../shared/util.h" //TESTED_CLASS= //TESTED_FILES= @@ -132,20 +133,24 @@ void tst_QToolTip::task183679() void tst_QToolTip::setPalette() { //the previous test may still have a tooltip pending for deletion - QTest::qWait(100); QVERIFY(!QToolTip::isVisible()); QToolTip::showText(QPoint(), "tool tip text", 0); - QTest::qWait(100); + + QTRY_VERIFY(QToolTip::isVisible()); QWidget *toolTip = 0; foreach (QWidget *widget, QApplication::topLevelWidgets()) { - if (widget->windowType() == Qt::ToolTip) { + if (widget->windowType() == Qt::ToolTip + && widget->objectName() == QLatin1String("qtooltip_label")) + { toolTip = widget; break; } } + QVERIFY(toolTip); + QTRY_VERIFY(toolTip->isVisible()); const QPalette oldPalette = toolTip->palette(); QPalette newPalette = oldPalette; |