diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2011-11-28 11:26:40 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 11:11:53 +0100 |
commit | 8872c0716fb33e33311a78e693b61d3dd6b656c1 (patch) | |
tree | 01b970d0cc196cb99b971f9905d3a002a1a97190 /tests/auto/qtquick2/qdeclarativestyledtext | |
parent | 76ed62fb836ea3e3e5236f8ed567f7ac64dd63fc (diff) |
Support inline images with <img> tag in StyledText
Task-number: QTBUG-21793
Change-Id: Ie7b9f293c6c9a949c1899152c38b61251b0069d3
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativestyledtext')
-rw-r--r-- | tests/auto/qtquick2/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qtquick2/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp b/tests/auto/qtquick2/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp index 46acbb2db3..b4e0ba1b7a 100644 --- a/tests/auto/qtquick2/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp +++ b/tests/auto/qtquick2/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp @@ -41,7 +41,8 @@ #include <qtest.h> #include <QtTest/QtTest> #include <QtGui/QTextLayout> -#include <private/qdeclarativestyledtext_p.h> +#include <QtCore/QList> +#include <QtQuick/private/qdeclarativestyledtext_p.h> class tst_qdeclarativestyledtext : public QObject { @@ -148,6 +149,7 @@ void tst_qdeclarativestyledtext::textOutput_data() QTest::newRow("space before bold") << "this is <b>bold</b>" << "this is bold" << (FormatList() << Format(Format::Bold, 8, 4)); QTest::newRow("space leading bold") << "this is<b> bold</b>" << "this is bold" << (FormatList() << Format(Format::Bold, 7, 5)); QTest::newRow("space trailing bold") << "this is <b>bold </b>" << "this is bold " << (FormatList() << Format(Format::Bold, 8, 5)); + QTest::newRow("img") << "a<img src=\"blah.png\"/>b" << "a b" << FormatList(); } void tst_qdeclarativestyledtext::textOutput() @@ -157,7 +159,8 @@ void tst_qdeclarativestyledtext::textOutput() QFETCH(FormatList, formats); QTextLayout layout; - QDeclarativeStyledText::parse(input, layout); + QList<QDeclarativeStyledTextImgTag*> imgTags; + QDeclarativeStyledText::parse(input, layout, imgTags, 0, false); QCOMPARE(layout.text(), output); |