summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstext.cpp28
-rw-r--r--src/declarative/util/qmltransition.cpp14
-rw-r--r--tests/auto/declarative/animations/data/badtype4.qml1
-rw-r--r--tests/auto/declarative/animations/data/mixedtype1.qml1
-rw-r--r--tests/auto/declarative/animations/data/mixedtype2.qml1
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp6
6 files changed, 26 insertions, 25 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstext.cpp b/src/declarative/graphicsitems/qmlgraphicstext.cpp
index 854d503..98ea80d 100644
--- a/src/declarative/graphicsitems/qmlgraphicstext.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstext.cpp
@@ -485,19 +485,19 @@ void QmlGraphicsTextPrivate::updateSize()
//setup instance of QTextLayout for all cases other than richtext
if (!richText)
- {
- tmp = text;
- tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
- singleline = !tmp.contains(QChar::LineSeparator);
- if (singleline && elideMode != QmlGraphicsText::ElideNone && q->widthValid())
- tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...?
- layout.clearLayout();
- layout.setFont(font);
- layout.setText(tmp);
- size = setupTextLayout(&layout);
- cachedLayoutSize = size;
- }
- if (richText) {
+ {
+ tmp = text;
+ tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
+ singleline = !tmp.contains(QChar::LineSeparator);
+ if (singleline && elideMode != QmlGraphicsText::ElideNone && q->widthValid())
+ tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...?
+ layout.clearLayout();
+ layout.setFont(font);
+ layout.setText(tmp);
+ size = setupTextLayout(&layout);
+ cachedLayoutSize = size;
+ dy -= size.height();
+ } else {
singleline = false; // richtext can't elide or be optimized for single-line case
doc->setDefaultFont(font);
QTextOption option((Qt::Alignment)int(hAlign | vAlign));
@@ -511,8 +511,6 @@ void QmlGraphicsTextPrivate::updateSize()
else
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
- } else {
- dy -= size.height();
}
int yoff = 0;
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index ec92cf9..dad6c37 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -85,7 +85,7 @@ public:
QmlTransitionPrivate() : fromState(QLatin1String("*")), toState(QLatin1String("*"))
, reversed(false), reversible(false), group(0), endState(0)
{
- operations.parent = this;
+ animations.parent = this;
}
QString fromState;
@@ -115,7 +115,7 @@ public:
QmlTransitionPrivate *parent;
};
- AnimationList operations;
+ AnimationList animations;
};
void QmlTransitionPrivate::AnimationList::append(QmlAbstractAnimation *a)
@@ -169,12 +169,12 @@ void QmlTransition::prepare(QmlStateOperation::ActionList &actions,
Q_D(QmlTransition);
if (d->reversed) {
- for (int ii = d->operations.count() - 1; ii >= 0; --ii) {
- d->operations.at(ii)->transition(actions, after, QmlAbstractAnimation::Backward);
+ for (int ii = d->animations.count() - 1; ii >= 0; --ii) {
+ d->animations.at(ii)->transition(actions, after, QmlAbstractAnimation::Backward);
}
} else {
- for (int ii = 0; ii < d->operations.count(); ++ii) {
- d->operations.at(ii)->transition(actions, after, QmlAbstractAnimation::Forward);
+ for (int ii = 0; ii < d->animations.count(); ++ii) {
+ d->animations.at(ii)->transition(actions, after, QmlAbstractAnimation::Forward);
}
}
@@ -254,7 +254,7 @@ void QmlTransition::setToState(const QString &t)
QmlList<QmlAbstractAnimation *>* QmlTransition::animations()
{
Q_D(QmlTransition);
- return &d->operations;
+ return &d->animations;
}
QT_END_NAMESPACE
diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml
index 5db6c17..347e581 100644
--- a/tests/auto/declarative/animations/data/badtype4.qml
+++ b/tests/auto/declarative/animations/data/badtype4.qml
@@ -6,6 +6,7 @@ Rectangle {
height: 320
Rectangle {
id: MyRect
+ objectName: "MyRect"
color: "red"
width: 50; height: 50
x: 100; y: 100
diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml
index 5ecf14f..a91c6d3 100644
--- a/tests/auto/declarative/animations/data/mixedtype1.qml
+++ b/tests/auto/declarative/animations/data/mixedtype1.qml
@@ -6,6 +6,7 @@ Rectangle {
height: 320
Rectangle {
id: MyRect
+ objectName: "MyRect"
color: "red"
width: 50; height: 50
x: 100; y: 100
diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml
index 645f1d0..d12e913 100644
--- a/tests/auto/declarative/animations/data/mixedtype2.qml
+++ b/tests/auto/declarative/animations/data/mixedtype2.qml
@@ -6,6 +6,7 @@ Rectangle {
height: 320
Rectangle {
id: MyRect
+ objectName: "MyRect"
color: "red"
width: 50; height: 50
x: 100; y: 100
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index 73bed79..a6cb490 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -284,7 +284,7 @@ void tst_animations::badTypes()
rect->setState("state1");
QTest::qWait(1000 + 50);
- QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect");
QVERIFY(myRect);
QCOMPARE(myRect->x(),qreal(200));
}
@@ -324,7 +324,7 @@ void tst_animations::mixedTypes()
rect->setState("state1");
QTest::qWait(500);
- QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect");
QVERIFY(myRect);
//rather inexact -- is there a better way?
@@ -340,7 +340,7 @@ void tst_animations::mixedTypes()
rect->setState("state1");
QTest::qWait(500);
- QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect");
QVERIFY(myRect);
//rather inexact -- is there a better way?