diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-05-09 16:25:58 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-05-10 11:53:47 +0200 |
commit | 66646dd8c37adb488a79ab274b2396a649674e6d (patch) | |
tree | b0f5ac752a52cec3de1d47692e09295197622dcd /src/quick/util | |
parent | da15ea0f3b5805db657f13060c21efa78f10cde2 (diff) | |
parent | d82a17b929dd88fe76258b0f801beaa1b2ee343e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
.qmake.conf
src/plugins/accessible/quick/quick.pro
src/quick/items/qquickpincharea.cpp
src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp
Manually adjusted for TestHTTPServer constructor change:
tests/auto/quick/qquickimage/tst_qquickimage.cpp
Change-Id: I5e58a7c08ea92d6fc5e3bce98571c54f7b2ce08f
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickanimation.cpp | 74 | ||||
-rw-r--r-- | src/quick/util/qquickanimation_p_p.h | 14 | ||||
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 52 | ||||
-rw-r--r-- | src/quick/util/qquickpath.cpp | 4 | ||||
-rw-r--r-- | src/quick/util/qquickprofiler.cpp | 13 | ||||
-rw-r--r-- | src/quick/util/qquickprofiler_p.h | 21 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 64 | ||||
-rw-r--r-- | src/quick/util/qquickpropertychanges_p.h | 4 | ||||
-rw-r--r-- | src/quick/util/qquicksmoothedanimation.cpp | 7 | ||||
-rw-r--r-- | src/quick/util/qquicksmoothedanimation_p_p.h | 1 | ||||
-rw-r--r-- | src/quick/util/qquickspringanimation.cpp | 10 | ||||
-rw-r--r-- | src/quick/util/qquickstyledtext.cpp | 2 | ||||
-rw-r--r-- | src/quick/util/qquicktimeline.cpp | 5 | ||||
-rw-r--r-- | src/quick/util/qquicktimeline_p_p.h | 1 |
14 files changed, 173 insertions, 99 deletions
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index 36316e27c0..10d2176d0a 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -200,19 +200,21 @@ QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const } /*! - \qmlsignal QtQuick::Animation::onStarted() + \qmlsignal QtQuick::Animation::started() - This signal handler is called when the animation begins. + This signal is emitted when the animation begins. It is only triggered for top-level, standalone animations. It will not be triggered for animations in a Behavior or Transition, or animations that are part of an animation group. + + The corresponding handler is \c onStarted. */ /*! - \qmlsignal QtQuick::Animation::onStopped() + \qmlsignal QtQuick::Animation::stopped() - This signal handler is called when the animation ends. + This signal is emitted when the animation ends. The animation may have been stopped manually, or may have run to completion. @@ -220,8 +222,10 @@ QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const triggered for animations in a Behavior or Transition, or animations that are part of an animation group. - If \l alwaysRunToEnd is true, onStopped will not be called until the animation + If \l alwaysRunToEnd is true, this signal will not be emitted until the animation has completed its current iteration. + + The corresponding handler is \c onStopped. */ void QQuickAbstractAnimation::setRunning(bool r) @@ -869,6 +873,19 @@ void QActionAnimation::updateState(State newState, State oldState) } } +void QActionAnimation::debugAnimation(QDebug d) const +{ + d << "ActionAnimation(" << hex << (void *) this << dec << ")"; + + if (animAction) { + int indentLevel = 1; + const QAbstractAnimationJob *job = this; + while ((job = job->group())) + ++indentLevel; + animAction->debugAction(d, indentLevel); + } +} + /*! \qmltype ScriptAction \instantiates QQuickScriptAction @@ -953,6 +970,22 @@ QAbstractAnimationAction* QQuickScriptActionPrivate::createAction() return new Proxy(this); } +void QQuickScriptActionPrivate::debugAction(QDebug d, int indentLevel) const +{ + QQmlScriptString scriptStr = hasRunScriptScript ? runScriptScript : script; + + if (!scriptStr.isEmpty()) { + QQmlExpression expr(scriptStr); + + QByteArray ind(indentLevel, ' '); + QString exprStr = expr.expression(); + int endOfFirstLine = exprStr.indexOf('\n'); + d << "\n" << ind.constData() << exprStr.left(endOfFirstLine); + if (endOfFirstLine != -1 && endOfFirstLine < exprStr.length()) + d << "..."; + } +} + void QQuickScriptActionPrivate::execute() { Q_Q(QQuickScriptAction); @@ -1166,6 +1199,14 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti QQmlPropertyPrivate::write(action.property, action.toValue, QQmlPropertyPrivate::BypassInterceptor | QQmlPropertyPrivate::DontRemoveBinding); } } + virtual void debugAction(QDebug d, int indentLevel) const { + QByteArray ind(indentLevel, ' '); + for (int ii = 0; ii < actions.count(); ++ii) { + const QQuickStateAction &action = actions.at(ii); + d << "\n" << ind.constData() << "target:" << action.property.object() << "property:" << action.property.name() + << "value:" << action.toValue; + } + } }; QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(',')); @@ -1925,6 +1966,19 @@ void QQuickBulkValueAnimator::topLevelAnimationLoopChanged() QAbstractAnimationJob::topLevelAnimationLoopChanged(); } +void QQuickBulkValueAnimator::debugAnimation(QDebug d) const +{ + d << "BulkValueAnimation(" << hex << (void *) this << dec << ")" << "duration:" << duration(); + + if (animValue) { + int indentLevel = 1; + const QAbstractAnimationJob *job = this; + while ((job = job->group())) + ++indentLevel; + animValue->debugUpdater(d, indentLevel); + } +} + /*! \qmltype PropertyAnimation \instantiates QQuickPropertyAnimation @@ -2498,6 +2552,16 @@ void QQuickAnimationPropertyUpdater::setValue(qreal v) fromSourced = true; } +void QQuickAnimationPropertyUpdater::debugUpdater(QDebug d, int indentLevel) const +{ + QByteArray ind(indentLevel, ' '); + for (int i = 0; i < actions.count(); ++i) { + const QQuickStateAction &action = actions.at(i); + d << "\n" << ind.constData() << "target:" << action.property.object() << "property:" << action.property.name() + << "from:" << action.fromValue << "to:" << action.toValue; + } +} + QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateActions &actions, QQmlProperties &modified, QObject *defaultTarget) diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h index 127f447e5d..f2b5f6388f 100644 --- a/src/quick/util/qquickanimation_p_p.h +++ b/src/quick/util/qquickanimation_p_p.h @@ -79,18 +79,19 @@ class QAbstractAnimationAction public: virtual ~QAbstractAnimationAction() {} virtual void doAction() = 0; + virtual void debugAction(QDebug, int) const {} }; //templated animation action //allows us to specify an action that calls a function of a class. //(so that class doesn't have to inherit QQuickAbstractAnimationAction) -template<class T, void (T::*method)()> +template<class T, void (T::*method)(), void (T::*debugMethod)(QDebug, int) const> class QAnimationActionProxy : public QAbstractAnimationAction { public: QAnimationActionProxy(T *instance) : m_instance(instance) {} virtual void doAction() { (m_instance->*method)(); } - + virtual void debugAction(QDebug d, int indentLevel) const { (m_instance->*debugMethod)(d, indentLevel); } private: T *m_instance; }; @@ -111,6 +112,7 @@ public: protected: virtual void updateCurrentTime(int); virtual void updateState(State newState, State oldState); + void debugAnimation(QDebug d) const; private: QAbstractAnimationAction *animAction; @@ -121,6 +123,7 @@ class QQuickBulkValueUpdater public: virtual ~QQuickBulkValueUpdater() {} virtual void setValue(qreal value) = 0; + virtual void debugUpdater(QDebug, int) const {} }; //animates QQuickBulkValueUpdater (assumes start and end values will be reals or compatible) @@ -145,6 +148,7 @@ public: protected: void updateCurrentTime(int currentTime); void topLevelAnimationLoopChanged(); + void debugAnimation(QDebug d) const; private: QQuickBulkValueUpdater *animValue; @@ -224,8 +228,10 @@ public: void execute(); QAbstractAnimationAction* createAction(); + void debugAction(QDebug d, int indentLevel) const; typedef QAnimationActionProxy<QQuickScriptActionPrivate, - &QQuickScriptActionPrivate::execute> Proxy; + &QQuickScriptActionPrivate::execute, + &QQuickScriptActionPrivate::debugAction> Proxy; }; class QQuickPropertyActionPrivate : public QQuickAbstractAnimationPrivate @@ -307,6 +313,8 @@ public: void setValue(qreal v); + void debugUpdater(QDebug d, int indentLevel) const; + QQuickStateActions actions; int interpolatorType; //for Number/ColorAnimation QVariantAnimation::Interpolator interpolator; diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 5ae74c2fec..4428452aa0 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -61,23 +61,9 @@ QT_BEGIN_NAMESPACE class QQuickColorProvider : public QQmlColorProvider { public: - static inline QColor QColorFromString(const QString &s) - { - // Should we also handle #rrggbb here? - if (s.length() == 9 && s.startsWith(QLatin1Char('#'))) { - uchar a = fromHex(s, 1); - uchar r = fromHex(s, 3); - uchar g = fromHex(s, 5); - uchar b = fromHex(s, 7); - return QColor(r, g, b, a); - } - - return QColor(s); - } - QVariant colorFromString(const QString &s, bool *ok) { - QColor c(QColorFromString(s)); + QColor c(s); if (c.isValid()) { if (ok) *ok = true; return QVariant(c); @@ -89,7 +75,7 @@ public: unsigned rgbaFromString(const QString &s, bool *ok) { - QColor c(QColorFromString(s)); + QColor c(s); if (c.isValid()) { if (ok) *ok = true; return c.rgba(); @@ -155,34 +141,6 @@ public: return QVariant::fromValue(QColor::fromRgbF(r, g, b, a + inv_a * baseColor.alphaF())); } - -private: - static uchar fromHex(const uchar c, const uchar c2) - { - uchar rv = 0; - if (c >= '0' && c <= '9') - rv += (c - '0') * 16; - else if (c >= 'A' && c <= 'F') - rv += (c - 'A' + 10) * 16; - else if (c >= 'a' && c <= 'f') - rv += (c - 'a' + 10) * 16; - - if (c2 >= '0' && c2 <= '9') - rv += (c2 - '0'); - else if (c2 >= 'A' && c2 <= 'F') - rv += (c2 - 'A' + 10); - else if (c2 >= 'a' && c2 <= 'f') - rv += (c2 - 'a' + 10); - - return rv; - } - - static inline uchar fromHex(const QString &s, int idx) - { - uchar c = s.at(idx).toLatin1(); - uchar c2 = s.at(idx + 1).toLatin1(); - return fromHex(c, c2); - } }; @@ -639,7 +597,7 @@ public: switch (type) { case QMetaType::QColor: - return createFromStringTyped<QColor>(data, dataSize, QQuickColorProvider::QColorFromString(s)); + return createFromStringTyped<QColor>(data, dataSize, QColor(s)); case QMetaType::QVector2D: return createFromStringTyped<QVector2D>(data, dataSize, vector2DFromString(s, &ok)); case QMetaType::QVector3D: @@ -677,7 +635,7 @@ public: bool variantFromString(const QString &s, QVariant *v) { - QColor c(QQuickColorProvider::QColorFromString(s)); + QColor c(s); if (c.isValid()) { *v = QVariant::fromValue(c); return true; @@ -725,7 +683,7 @@ public: switch (type) { case QMetaType::QColor: { - QColor c(QQuickColorProvider::QColorFromString(s)); + QColor c(s); *v = QVariant::fromValue(c); return true; } diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index 25e40d8eb6..7e8b71da63 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -320,8 +320,6 @@ void QQuickPath::endpoint(QList<AttributePoint> &attributePoints, const QString } } -static QString percentString(QLatin1String("_qfx_percent")); - void QQuickPath::processPath() { Q_D(QQuickPath); @@ -358,6 +356,8 @@ QPainterPath QQuickPath::createPath(const QPointF &startPoint, const QPointF &en qreal startY = d->startY.isValid() ? d->startY.value : startPoint.y(); path.moveTo(startX, startY); + const QString percentString = QStringLiteral("_qfx_percent"); + bool usesPercent = false; int index = 0; foreach (QQuickPathElement *pathElement, d->_pathElements) { diff --git a/src/quick/util/qquickprofiler.cpp b/src/quick/util/qquickprofiler.cpp index 0bd22d1d25..4418f6dd9c 100644 --- a/src/quick/util/qquickprofiler.cpp +++ b/src/quick/util/qquickprofiler.cpp @@ -72,7 +72,7 @@ void QQuickProfilerData::toByteArrays(QList<QByteArray> &messages) const switch (decodedMessageType) { case QQuickProfiler::Event: if (decodedDetailType == (int)QQuickProfiler::AnimationFrame) - ds << framerate << count; + ds << framerate << count << threadId; break; case QQuickProfiler::PixmapCacheEvent: ds << detailUrl.toString(); @@ -137,7 +137,14 @@ void QQuickProfiler::initialize() void animationTimerCallback(qint64 delta) { - Q_QUICK_PROFILE(animationFrame(delta)); + Q_QUICK_PROFILE(animationFrame(delta, + QThread::currentThread() == QCoreApplication::instance()->thread() ? + QQuickProfiler::GuiThread : QQuickProfiler::RenderThread)); +} + +void QQuickProfiler::registerAnimationCallback() +{ + QUnifiedTimer::instance()->registerProfilerCallback(&animationTimerCallback); } class CallbackRegistrationHelper : public QObject { @@ -145,7 +152,7 @@ class CallbackRegistrationHelper : public QObject { public slots: void registerAnimationTimerCallback() { - QUnifiedTimer::instance()->registerProfilerCallback(&animationTimerCallback); + QQuickProfiler::registerAnimationCallback(); delete this; } }; diff --git a/src/quick/util/qquickprofiler_p.h b/src/quick/util/qquickprofiler_p.h index 721560b9e5..03cef951b5 100644 --- a/src/quick/util/qquickprofiler_p.h +++ b/src/quick/util/qquickprofiler_p.h @@ -95,9 +95,9 @@ struct Q_AUTOTEST_EXPORT QQuickProfilerData framerate(framerate), count(count) {} QQuickProfilerData(qint64 time, int messageType, int detailType, int framerate = 0, - int count = 0) : + int count = 0, int threadId = 0) : time(time), messageType(messageType), detailType(detailType), framerate(framerate), - count(count) {} + count(count), threadId(threadId) {} // Special ctor for scenegraph frames. Note that it's missing the QString/QUrl params. // This is slightly ugly, but makes it easier to disambiguate between int and qint64 params. @@ -133,7 +133,10 @@ struct Q_AUTOTEST_EXPORT QQuickProfilerData int count; //used by animation events and for pixmaps }; - qint64 subtime_5; + union { + qint64 subtime_5; + int threadId; + }; void toByteArrays(QList<QByteArray> &messages) const; }; @@ -144,6 +147,11 @@ class Q_QUICK_PRIVATE_EXPORT QQuickProfiler : public QQmlAbstractProfilerAdapter Q_OBJECT public: + enum AnimationThread { + GuiThread, + RenderThread + }; + template<EventType DetailType> static void addEvent() { @@ -151,13 +159,14 @@ public: 1 << DetailType)); } - static void animationFrame(qint64 delta) + static void animationFrame(qint64 delta, AnimationThread threadId) { int animCount = QUnifiedTimer::instance()->runningAnimationCount(); if (animCount > 0 && delta > 0) { s_instance->processMessage(QQuickProfilerData(s_instance->timestamp(), 1 << Event, - 1 << AnimationFrame, 1000 / (int)delta /* trim fps to integer */, animCount)); + 1 << AnimationFrame, 1000 / (int)delta /* trim fps to integer */, animCount, + threadId)); } } @@ -191,6 +200,8 @@ public: 1 << PixmapCacheEvent, 1 << CountType, url, 0, 0, 0, count)); } + static void registerAnimationCallback(); + qint64 timestamp() { return m_timer.nsecsElapsed(); } qint64 sendMessages(qint64 until, QList<QByteArray> &messages); diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index b2f490e3c8..1786317356 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -46,9 +46,9 @@ #include <qqmlinfo.h> #include <private/qqmlcustomparser_p.h> -#include <private/qqmlscript_p.h> #include <qqmlexpression.h> #include <private/qqmlbinding_p.h> +#include <private/qqmlcompiler_p.h> #include <qqmlcontext.h> #include <private/qqmlproperty_p.h> #include <private/qqmlcontext_p.h> @@ -205,6 +205,7 @@ public: QPointer<QObject> object; QByteArray data; + QQmlRefPointer<QQmlCompiledData> cdata; bool decoded : 1; bool restore : 1; @@ -259,9 +260,8 @@ void QQuickPropertyChangesParser::compileList(QList<QPair<QString, const QV4::Co list << qMakePair(propName, binding); } -QByteArray QQuickPropertyChangesParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList<const QV4::CompiledData::Binding *> &props) +QByteArray QQuickPropertyChangesParser::compile(const QV4::CompiledData::QmlUnit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &props) { - Q_UNUSED(objectIndex) QList<QPair<QString, const QV4::CompiledData::Binding *> > data; for (int ii = 0; ii < props.count(); ++ii) compileList(data, QString(), qmlUnit, props.at(ii)); @@ -272,12 +272,13 @@ QByteArray QQuickPropertyChangesParser::compile(const QV4::CompiledData::QmlUnit ds << data.count(); for (int ii = 0; ii < data.count(); ++ii) { const QV4::CompiledData::Binding *binding = data.at(ii).second; + ds << data.at(ii).first << int(binding->type); QVariant var; - bool isScript = binding->type == QV4::CompiledData::Binding::Type_Script; - QQmlBinding::Identifier id = QQmlBinding::Invalid; switch (binding->type) { case QV4::CompiledData::Binding::Type_Script: - // ### pre-compile binding + ds << bindingIdentifier(binding); + // Fall through as we also need the expression string. + // Signal handlers still need to be constructed by string ;( case QV4::CompiledData::Binding::Type_String: var = binding->valueAsString(&qmlUnit->header); break; @@ -289,13 +290,12 @@ QByteArray QQuickPropertyChangesParser::compile(const QV4::CompiledData::QmlUnit break; case QV4::CompiledData::Binding::Type_Translation: case QV4::CompiledData::Binding::Type_TranslationById: - Q_UNREACHABLE(); + ds << binding->value.translationData.commentIndex << binding->value.translationData.number; + var = binding->stringIndex; default: break; } - ds << data.at(ii).first << isScript << var; - if (isScript) - ds << id; + ds << var; } return rv; @@ -313,36 +313,30 @@ void QQuickPropertyChangesPrivate::decode() ds >> count; for (int ii = 0; ii < count; ++ii) { QString name; - bool isScript; + int type; QVariant data; QQmlBinding::Identifier id = QQmlBinding::Invalid; + QV4::CompiledData::TranslationData tsd; ds >> name; - ds >> isScript; - ds >> data; - if (isScript) + ds >> type; + + if (type == QV4::CompiledData::Binding::Type_Script) { ds >> id; + } else if (type == QV4::CompiledData::Binding::Type_Translation + || type == QV4::CompiledData::Binding::Type_TranslationById) { + ds >> tsd.commentIndex >> tsd.number; + } + + ds >> data; QQmlProperty prop = property(name); //### better way to check for signal property? if (prop.type() & QQmlProperty::SignalProperty) { - QString expression = data.toString(); - QUrl url = QUrl(); - int line = -1; - int column = -1; - - QQmlData *ddata = QQmlData::get(q); - if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { - url = ddata->outerContext->url; - line = ddata->lineNumber; - column = ddata->columnNumber; - } - QQuickReplaceSignalHandler *handler = new QQuickReplaceSignalHandler; handler->property = prop; handler->expression.take(new QQmlBoundSignalExpression(object, QQmlPropertyPrivate::get(prop)->signalIndex(), - QQmlContextData::get(qmlContext(q)), object, expression, - url.toString(), line, column)); + QQmlContextData::get(qmlContext(q)), object, cdata->functionForBindingId(id))); signalReplacements << handler; - } else if (isScript) { // binding + } else if (type == QV4::CompiledData::Binding::Type_Script) { // binding QString expression = data.toString(); QUrl url = QUrl(); int line = -1; @@ -357,6 +351,14 @@ void QQuickPropertyChangesPrivate::decode() expressions << ExpressionChange(name, id, expression, url, line, column); } else { + if (type == QV4::CompiledData::Binding::Type_Translation + || type == QV4::CompiledData::Binding::Type_TranslationById) { + QV4::CompiledData::Binding tmpBinding; + tmpBinding.type = type; + tmpBinding.stringIndex = data.toInt(); + tmpBinding.value.translationData = tsd; + data = tmpBinding.valueAsString(&cdata->qmlUnit->header); + } properties << qMakePair(name, data); } } @@ -364,12 +366,12 @@ void QQuickPropertyChangesPrivate::decode() data.clear(); } -void QQuickPropertyChangesParser::setCustomData(QObject *object, - const QByteArray &data) +void QQuickPropertyChangesParser::setCustomData(QObject *object, const QByteArray &data, QQmlCompiledData *cdata) { QQuickPropertyChangesPrivate *p = static_cast<QQuickPropertyChangesPrivate *>(QObjectPrivate::get(object)); p->data = data; + p->cdata = cdata; p->decoded = false; } diff --git a/src/quick/util/qquickpropertychanges_p.h b/src/quick/util/qquickpropertychanges_p.h index 6d238f5ca5..3eed151d11 100644 --- a/src/quick/util/qquickpropertychanges_p.h +++ b/src/quick/util/qquickpropertychanges_p.h @@ -94,8 +94,8 @@ public: void compileList(QList<QPair<QString, const QV4::CompiledData::Binding *> > &list, const QString &pre, const QV4::CompiledData::QmlUnit *qmlUnit, const QV4::CompiledData::Binding *binding); - virtual QByteArray compile(const QV4::CompiledData::QmlUnit *qmlUnit, int objectIndex, const QList<const QV4::CompiledData::Binding *> &props); - virtual void setCustomData(QObject *, const QByteArray &); + virtual QByteArray compile(const QV4::CompiledData::QmlUnit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &props); + virtual void setCustomData(QObject *, const QByteArray &, QQmlCompiledData *); }; diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index a0e6c36830..a23f7a5df6 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -313,6 +313,13 @@ void QSmoothedAnimation::init() } } +void QSmoothedAnimation::debugAnimation(QDebug d) const +{ + d << "SmoothedAnimationJob(" << hex << (void *) this << dec << ")" << "duration:" << userDuration + << "velocity:" << velocity << "target:" << target.object() << "property:" << target.name() + << "to:" << to << "current velocity:" << trackVelocity; +} + /*! \qmltype SmoothedAnimation \instantiates QQuickSmoothedAnimation diff --git a/src/quick/util/qquicksmoothedanimation_p_p.h b/src/quick/util/qquicksmoothedanimation_p_p.h index 7835d0328b..3c85f09b04 100644 --- a/src/quick/util/qquicksmoothedanimation_p_p.h +++ b/src/quick/util/qquicksmoothedanimation_p_p.h @@ -105,6 +105,7 @@ public: protected: virtual void updateCurrentTime(int); virtual void updateState(QAbstractAnimationJob::State, QAbstractAnimationJob::State); + void debugAnimation(QDebug d) const; private: qreal easeFollow(qreal); diff --git a/src/quick/util/qquickspringanimation.cpp b/src/quick/util/qquickspringanimation.cpp index f237c09bf9..4b1abcef8c 100644 --- a/src/quick/util/qquickspringanimation.cpp +++ b/src/quick/util/qquickspringanimation.cpp @@ -101,6 +101,7 @@ public: protected: virtual void updateCurrentTime(int time); virtual void updateState(QAbstractAnimationJob::State, QAbstractAnimationJob::State); + void debugAnimation(QDebug d) const; private: QQuickSpringAnimationPrivate *animationTemplate; @@ -320,6 +321,15 @@ void QSpringAnimation::updateState(QAbstractAnimationJob::State newState, QAbstr init(); } +void QSpringAnimation::debugAnimation(QDebug d) const +{ + d << "SpringAnimationJob(" << hex << (void *) this << dec << ")" << "velocity:" << maxVelocity + << "spring:" << spring << "damping:" << damping << "epsilon:" << epsilon << "modulus:" << modulus + << "mass:" << mass << "target:" << target.object() << "property:" << target.name() + << "to:" << to << "current velocity:" << velocity; +} + + void QQuickSpringAnimationPrivate::updateMode() { if (spring == 0. && maxVelocity == 0.) diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp index f2b2d2af06..80586bd45b 100644 --- a/src/quick/util/qquickstyledtext.cpp +++ b/src/quick/util/qquickstyledtext.cpp @@ -89,7 +89,7 @@ public: QQmlContext *context, bool preloadImages, bool *fontSizeModified) - : text(t), layout(l), imgTags(&imgTags), baseFont(layout.font()), baseUrl(baseUrl), hasNewLine(false), nbImages(0), updateImagePositions(false) + : text(t), layout(l), imgTags(&imgTags), baseFont(layout.font()), baseUrl(baseUrl), hasNewLine(true), nbImages(0), updateImagePositions(false) , preFormat(false), prependSpace(false), hasSpace(true), preloadImages(preloadImages), fontSizeModified(fontSizeModified), context(context) { } diff --git a/src/quick/util/qquicktimeline.cpp b/src/quick/util/qquicktimeline.cpp index 94e1f30215..f9928c4d00 100644 --- a/src/quick/util/qquicktimeline.cpp +++ b/src/quick/util/qquicktimeline.cpp @@ -723,6 +723,11 @@ void QQuickTimeLine::updateCurrentTime(int v) } } +void QQuickTimeLine::debugAnimation(QDebug d) const +{ + d << "QuickTimeLine(" << hex << (void *) this << dec << ")"; +} + bool operator<(const QPair<int, Update> &lhs, const QPair<int, Update> &rhs) { diff --git a/src/quick/util/qquicktimeline_p_p.h b/src/quick/util/qquicktimeline_p_p.h index a99a515f0a..0172ecbfcf 100644 --- a/src/quick/util/qquicktimeline_p_p.h +++ b/src/quick/util/qquicktimeline_p_p.h @@ -109,6 +109,7 @@ Q_SIGNALS: protected: virtual void updateCurrentTime(int); + void debugAnimation(QDebug d) const; private: void remove(QQuickTimeLineObject *); |