summaryrefslogtreecommitdiffstats
path: root/tests/auto/qapplication/tst_qapplication.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-10-28 09:03:25 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-10-28 09:03:25 (GMT)
commit2ecf21f48b9d328b4d732848d1d20115d1891c42 (patch)
tree1fe81d9a4fc5640dca29ebf5ca2e048d805dda15 /tests/auto/qapplication/tst_qapplication.cpp
parent1ec19ed5a69b8b0e11c81037c270072736f48e40 (diff)
parent0313ccbfaff690c5a8fc18a3a2c7d976a4a55aaf (diff)
downloadQt-2ecf21f48b9d328b4d732848d1d20115d1891c42.zip
Qt-2ecf21f48b9d328b4d732848d1d20115d1891c42.tar.gz
Qt-2ecf21f48b9d328b4d732848d1d20115d1891c42.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-platform-team into 4.6-WM_NULL-driven
Diffstat (limited to 'tests/auto/qapplication/tst_qapplication.cpp')
-rw-r--r--tests/auto/qapplication/tst_qapplication.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp
index 675e559..5888866 100644
--- a/tests/auto/qapplication/tst_qapplication.cpp
+++ b/tests/auto/qapplication/tst_qapplication.cpp
@@ -129,6 +129,7 @@ private slots:
void style();
void allWidgets();
+ void topLevelWidgets();
void setAttribute();
@@ -1795,6 +1796,27 @@ void tst_QApplication::allWidgets()
QVERIFY(!app.allWidgets().contains(w)); // removal test
}
+void tst_QApplication::topLevelWidgets()
+{
+ int argc = 1;
+ QApplication app(argc, &argv0, QApplication::GuiServer);
+ QWidget *w = new QWidget;
+ w->show();
+#ifndef QT_NO_CLIPBOARD
+ QClipboard *clipboard = QApplication::clipboard();
+ QString originalText = clipboard->text();
+ clipboard->setText(QString("newText"));
+#endif
+ app.processEvents();
+ QVERIFY(QApplication::topLevelWidgets().contains(w));
+ QCOMPARE(QApplication::topLevelWidgets().count(), 1);
+ delete w;
+ w = 0;
+ app.processEvents();
+ QCOMPARE(QApplication::topLevelWidgets().count(), 0);
+}
+
+
void tst_QApplication::setAttribute()
{