diff options
-rw-r--r-- | examples/declarative/listview/dynamic.qml | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxtext.cpp | 21 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 7 |
3 files changed, 15 insertions, 17 deletions
diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index dde24f6..52c3c0b 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -59,8 +59,8 @@ Item { id: FruitDelegate Item { width: parent.width; height: 55 - Text { id: Label; font.pixelSize: 24; text: name } - Text { font.pixelSize: 24; text: '$'+Number(cost).toFixed(2); anchors.right: ItemButtons.left } + Text { id: Label; font.pixelSize: 24; text: name; elide: "ElideRight"; anchors.right: Cost.left; anchors.left:parent.left } + Text { id: Cost; font.pixelSize: 24; text: '$'+Number(cost).toFixed(2); anchors.right: ItemButtons.left } Row { anchors.top: Label.bottom spacing: 5 diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index c60aaf2..5b10289 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -466,9 +466,6 @@ void QFxTextPrivate::updateSize() { Q_Q(QFxText); if (q->isComponentComplete()) { - if (text.isEmpty()) { - return; - } QFontMetrics fm(font); int dy = q->height(); @@ -633,15 +630,17 @@ QPixmap QFxTextPrivate::wrappedTextImage(bool drawStyle) //paint text QPixmap img(size); - img.fill(Qt::transparent); - QPainter p(&img); - if (drawStyle) { - p.setPen(styleColor); + if (!size.isEmpty()) { + img.fill(Qt::transparent); + QPainter p(&img); + if (drawStyle) { + p.setPen(styleColor); + } + else + p.setPen(color); + p.setFont(font); + layout.draw(&p, QPointF(0, 0)); } - else - p.setPen(color); - p.setFont(font); - layout.draw(&p, QPointF(0, 0)); return img; } diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index affb93b..b305619 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -880,15 +880,14 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) if (vt == QVariant::ByteArray) { u = QUrl(QLatin1String(value.toByteArray())); found = true; - } else if (QVariant::String) { + } else if (vt == QVariant::String) { u = QUrl(value.toString()); found = true; } - if (context && u.isRelative()) - u = context->baseUrl().resolved(u); - if (found) { + if (context && u.isRelative() && !u.isEmpty()) + u = context->baseUrl().resolved(u); void *a[1]; a[0] = &u; QMetaObject::metacall(object, |