summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetext
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativetext')
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml b/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml
new file mode 100644
index 0000000..60ae15c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+
+Text {
+ text: "Hello World"
+ elide: Text.ElideRight
+ width: 30
+}
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 3d6641b..557603f 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -390,6 +390,13 @@ void tst_qdeclarativetext::elide()
QCOMPARE(textObject->width(), 100.);
}
}
+
+ // QTBUG-18627
+ QUrl qmlfile = QUrl::fromLocalFile(SRCDIR "/data/elideimplicitwidth.qml");
+ QDeclarativeComponent textComponent(&engine, qmlfile);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(textComponent.create());
+ QVERIFY(item != 0);
+ QVERIFY(item->implicitWidth() > item->width());
}
void tst_qdeclarativetext::textFormat()