From 0ea02a0576ebbc9cf8dfa9fb6c8137f2eb261422 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 2 Aug 2010 12:24:57 +1000 Subject: Update QtGui def files Task-number: QTBUG-12333 Reviewed-by: Martin Jones --- src/s60installs/bwins/QtGuiu.def | 3 +++ src/s60installs/eabi/QtGuiu.def | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 53ec18c..7844688 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12883,4 +12883,7 @@ EXPORTS ?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool) ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int) ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool) + ?zScaleChanged@QGraphicsScale@@IAEXXZ @ 12885 NONAME ; void QGraphicsScale::zScaleChanged(void) + ?xScaleChanged@QGraphicsScale@@IAEXXZ @ 12886 NONAME ; void QGraphicsScale::xScaleChanged(void) + ?yScaleChanged@QGraphicsScale@@IAEXXZ @ 12887 NONAME ; void QGraphicsScale::yScaleChanged(void) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 559c896..a22b4d9 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12088,4 +12088,7 @@ EXPORTS _ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME _ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME + _ZN14QGraphicsScale13xScaleChangedEv @ 12090 NONAME + _ZN14QGraphicsScale13yScaleChangedEv @ 12091 NONAME + _ZN14QGraphicsScale13zScaleChangedEv @ 12092 NONAME -- cgit v0.12 From 969daadd245153e8bb6c9a89a51565b83832f484 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 2 Aug 2010 15:36:35 +1000 Subject: Correctly apply PropertyChanges when entering an extended state directly from the base state. Make sure qmlExecuteDeferred is called on the state being extended. Task-number: QTBUG-12559 --- src/declarative/util/qdeclarativestate.cpp | 4 +++- .../qdeclarativestates/data/extendsBug.qml | 26 ++++++++++++++++++++++ .../qdeclarativestates/tst_qdeclarativestates.cpp | 16 +++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativestates/data/extendsBug.qml diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 9f4cc39..f7dae10 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -358,8 +358,10 @@ QDeclarativeStatePrivate::generateActionList(QDeclarativeStateGroup *group) cons if (!extends.isEmpty()) { QList states = group->states(); for (int ii = 0; ii < states.count(); ++ii) - if (states.at(ii)->name() == extends) + if (states.at(ii)->name() == extends) { + qmlExecuteDeferred(states.at(ii)); applyList = static_cast(states.at(ii)->d_func())->generateActionList(group); + } } foreach(QDeclarativeStateOperation *op, operations) diff --git a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml new file mode 100644 index 0000000..a3c4827 --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml @@ -0,0 +1,26 @@ +import Qt 4.7 + +Rectangle { + width: 200 + height: 200 + + Rectangle { + id: rect + objectName: "greenRect" + width: 100 + height: 100 + color: "green" + } + + states:[ + State { + name: "a" + PropertyChanges { target: rect; x: 100 } + }, + State { + name: "b" + extend:"a" + PropertyChanges { target: rect; y: 100 } + } + ] +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 3b6a420..6ae2759 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -139,6 +139,7 @@ private slots: void urlResolution(); void unnamedWhen(); void returnToBase(); + void extendsBug(); }; void tst_qdeclarativestates::initTestCase() @@ -1186,6 +1187,21 @@ void tst_qdeclarativestates::returnToBase() QCOMPARE(rect->property("stateString").toString(), QLatin1String("originalState")); } +//QTBUG-12559 +void tst_qdeclarativestates::extendsBug() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml"); + QDeclarativeRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + QDeclarativeRectangle *greenRect = rect->findChild("greenRect"); + + rectPrivate->setState("b"); + QCOMPARE(greenRect->x(), qreal(100)); + QCOMPARE(greenRect->y(), qreal(100)); +} QTEST_MAIN(tst_qdeclarativestates) -- cgit v0.12