summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-02-11 02:13:22 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-17 05:26:47 +0100
commit1209fccaf7c78f46f7d30cf729ed34e12e295e62 (patch)
tree9f6b52b604ad4d7c7f265c884d0ee7babb3e4520 /tests
parentcb8445f0323b0eefbb04f1d8adad81a00b53abd8 (diff)
QMimeData: export URLs as text too
This allows to drop or paste them into lineedits and text widgets (including such widgets in non-Qt applications) Implementation note: this is done on-demand rather than in setUrls so that it's still possible to setText explicitely; the new code is only a fallback for when no text/plain data is available. Change-Id: Ie90c43a30bfa64a6047b627e7351d20bf5ec8e03 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
index 09f17602b3..f9a6bae087 100644
--- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
+++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
@@ -317,19 +317,22 @@ void tst_QMimeData::setUrls() const
longUrlList += QUrl("http://www.google.com");
// verify initial state
- QVERIFY(mimeData.hasUrls() == false);
+ QCOMPARE(mimeData.hasUrls(), false);
// set a few, verify
mimeData.setUrls(shortUrlList);
QCOMPARE(mimeData.urls(), shortUrlList);
+ QCOMPARE(mimeData.text(), QString("http://qt.nokia.com"));
// change them, verify
mimeData.setUrls(longUrlList);
QCOMPARE(mimeData.urls(), longUrlList);
+ QCOMPARE(mimeData.text(), QString("http://qt.nokia.com\nhttp://www.google.com\n"));
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasUrls() == false);
+ QCOMPARE(mimeData.hasUrls(), false);
+ QCOMPARE(mimeData.hasText(), false);
}
QTEST_MAIN(tst_QMimeData)