diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-20 04:34:50 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-20 04:34:50 (GMT) |
commit | 214285b246d8cd65900a21262585b55767b4b8b3 (patch) | |
tree | dfa5f532757aef26f4f9c4354c5f3a4369710788 /src | |
parent | 7fe26e119685dfc694dcf5bd1dceeeb1226f3dfd (diff) | |
parent | 04eae20d3b86cc61ab3b3bdded74caa370a84c43 (diff) | |
download | Qt-214285b246d8cd65900a21262585b55767b4b8b3.zip Qt-214285b246d8cd65900a21262585b55767b4b8b3.tar.gz Qt-214285b246d8cd65900a21262585b55767b4b8b3.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 8 | ||||
-rw-r--r-- | src/declarative/extra/qmlfontloader.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlsqldatabase.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 3 | ||||
-rw-r--r-- | src/declarative/util/qmlstateoperations.cpp | 47 |
5 files changed, 46 insertions, 20 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index c775a00..8d34a98 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -228,11 +228,7 @@ void QUnifiedTimer::updateAnimationsTime() void QUnifiedTimer::restartAnimationTimer() { - if (runningLeafAnimations == 0 && !runningPauseAnimations.isEmpty()) { - int closestTimeToFinish = closestPauseAnimationTimeToFinish(); - animationTimer.start(closestTimeToFinish, this); - isPauseTimerActive = true; - } else if (!animationTimer.isActive() || isPauseTimerActive) { + if (!animationTimer.isActive()) { animationTimer.start(timingInterval, this); isPauseTimerActive = false; } @@ -328,7 +324,7 @@ int QUnifiedTimer::closestPauseAnimationTimeToFinish() int timeToFinish; if (animation->direction() == QAbstractAnimation::Forward) - timeToFinish = animation->totalDuration() - QAbstractAnimationPrivate::get(animation)->totalCurrentTime; + timeToFinish = animation->duration() - QAbstractAnimationPrivate::get(animation)->currentTime; else timeToFinish = QAbstractAnimationPrivate::get(animation)->totalCurrentTime; diff --git a/src/declarative/extra/qmlfontloader.cpp b/src/declarative/extra/qmlfontloader.cpp index 4a447de..2193b68 100644 --- a/src/declarative/extra/qmlfontloader.cpp +++ b/src/declarative/extra/qmlfontloader.cpp @@ -75,13 +75,13 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,FontLoader,QmlFontLoader) \brief This item allows using fonts by name or url. Example: - \code + \qml FontLoader { id: FixedFont; name: "Courier" } FontLoader { id: WebFont; source: "http://www.mysite.com/myfont.ttf" } Text { text: "Fixed-size font"; font.family: FixedFont.name } Text { text: "Fancy font"; font.family: WebFont.name } - \endcode + \endqml */ QmlFontLoader::QmlFontLoader(QObject *parent) : QObject(*(new QmlFontLoaderPrivate), parent) diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp index b132c55..4a5983d 100644 --- a/src/declarative/qml/qmlsqldatabase.cpp +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -312,6 +312,9 @@ static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptE } +/* + Currently documented in doc/src/declarastive/globalobject.qdoc +*/ static QScriptValue qmlsqldatabase_open(QScriptContext *context, QScriptEngine *engine) { QSqlDatabase database; @@ -343,6 +346,7 @@ static QScriptValue qmlsqldatabase_open(QScriptContext *context, QScriptEngine * ini.setValue(QLatin1String("Version"), dbversion); ini.setValue(QLatin1String("Description"), dbdescription); ini.setValue(QLatin1String("EstimatedSize"), dbestimatedsize); + ini.setValue(QLatin1String("DbType"), QLatin1String("QSQLITE")); database.open(); } diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 98facd9..7e4e992 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -350,7 +350,6 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever if (action.event) { if (!action.event->isReversable()) continue; - action.event->saveOriginals(); for (jj = 0; jj < d->revertList.count(); ++jj) { ActionEvent *event = d->revertList.at(jj).event; if (event && event->typeName() == action.event->typeName()) { @@ -360,6 +359,8 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever } } } + if (!found || action.event != d->revertList.at(jj).event) + action.event->saveOriginals(); } else { action.fromBinding = action.property.binding(); diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index 60fd421..053cdc3 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -70,10 +70,11 @@ public: void QmlParentChangePrivate::doChange(QFxItem *targetParent, QFxItem *stackBefore) { if (targetParent && target && target->parentItem()) { - //### for backwards direction, we can just restore original x, y, scale, rotation + //### for backwards direction, can we just restore original x, y, scale, rotation Q_Q(QmlParentChange); - const QTransform &transform = target->itemTransform(targetParent); - if (transform.type() >= QTransform::TxShear) { + bool ok; + const QTransform &transform = target->itemTransform(targetParent, &ok); + if (transform.type() >= QTransform::TxShear || !ok) { qmlInfo(QObject::tr("Unable to preserve appearance under complex transform"), q); } @@ -82,25 +83,49 @@ void QmlParentChangePrivate::doChange(QFxItem *targetParent, QFxItem *stackBefor if (transform.type() != QTransform::TxRotate) { if (transform.m11() == transform.m22()) scale = transform.m11(); - else + else { qmlInfo(QObject::tr("Unable to preserve appearance under non-uniform scale"), q); + ok = false; + } } else if (transform.type() == QTransform::TxRotate) { if (transform.m11() == transform.m22()) scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12()); - else + else { qmlInfo(QObject::tr("Unable to preserve appearance under non-uniform scale"), q); + ok = false; + } if (scale != 0) rotation = atan2(transform.m12()/scale, transform.m11()/scale) * 180/M_PI; - else + else { qmlInfo(QObject::tr("Unable to preserve appearance under scale of 0"), q); + ok = false; + } } + + qreal xt = transform.dx(); + qreal yt = transform.dy(); + if (target->transformOrigin() != QFxItem::TopLeft) { + qreal tempxt = target->transformOriginPoint().x(); + qreal tempyt = target->transformOriginPoint().y(); + QTransform t; + t.translate(-tempxt, -tempyt); + t.rotate(rotation); + t.scale(scale, scale); + t.translate(tempxt, tempyt); + QPointF offset = t.map(QPointF(0,0)); + xt += offset.x(); + yt += offset.y(); + } + target->setParentItem(targetParent); - //qDebug() << transform.dx() << transform.dy() << rotation << scale; - target->setX(transform.dx()); - target->setY(transform.dy()); - target->setRotation(rotation); - target->setScale(scale); + if (ok) { + //qDebug() << xt << yt << rotation << scale; + target->setX(xt); + target->setY(yt); + target->setRotation(rotation); + target->setScale(scale); + } } else if (target) { target->setParentItem(targetParent); } |