aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-31 14:40:20 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-02 16:23:26 +0000
commit6ee2028354f06afca42f2cb33fe53ce323de1b95 (patch)
tree2710379dccb7cb63540bf075993ff7e2ac516650
parente7dae6e672b675a9cdab58bcef4ac22bc494c256 (diff)
Improve debug formatting of QAbstractAnimationJob and related classes.
- Output the state. - Add output to QQuickAnimatorJob. - Add a private export to the debug operator for use by QQuickAnimatorProxyJob to format its contained job. Task-number: QTBUG-45220 Change-Id: Ic64bb5d949864de1c4fb322d53acc3e253977e5d Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp3
-rw-r--r--src/qml/animations/qabstractanimationjob_p.h4
-rw-r--r--src/quick/util/qquickanimatorjob.cpp15
-rw-r--r--src/quick/util/qquickanimatorjob_p.h2
4 files changed, 21 insertions, 3 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index 9548a18553..7fcf383bcb 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -652,7 +652,8 @@ void QAbstractAnimationJob::removeAnimationChangeListener(QAnimationJobChangeLis
void QAbstractAnimationJob::debugAnimation(QDebug d) const
{
- d << "AbstractAnimationJob(" << hex << (void *) this << dec << ")" << "duration:" << duration();
+ d << "AbstractAnimationJob(" << hex << (void *) this << dec << ") state:"
+ << m_state << "duration:" << duration();
}
QDebug operator<<(QDebug d, const QAbstractAnimationJob *job)
diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h
index cba6e35170..5a3e9d2025 100644
--- a/src/qml/animations/qabstractanimationjob_p.h
+++ b/src/qml/animations/qabstractanimationjob_p.h
@@ -163,7 +163,7 @@ protected:
friend class QQmlAnimationTimer;
friend class QAnimationGroupJob;
- friend QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
+ friend Q_QML_PRIVATE_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
};
class Q_QML_PRIVATE_EXPORT QAnimationJobChangeListener
@@ -234,7 +234,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractAnimationJob::ChangeTypes)
-QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
+Q_QML_PRIVATE_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
QT_END_NAMESPACE
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index dbd1a662df..8b617e5e3f 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -42,6 +42,7 @@
#include <private/qanimationgroupjob_p.h>
#include <qcoreapplication.h>
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -133,6 +134,13 @@ void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState,
}
}
+void QQuickAnimatorProxyJob::debugAnimation(QDebug d) const
+{
+ d << "QuickAnimatorProxyJob("<< hex << (void *) this << dec
+ << "state:" << state() << "duration:" << duration()
+ << "proxying: (" << job() << ')';
+}
+
void QQuickAnimatorProxyJob::windowChanged(QQuickWindow *window)
{
setWindow(window);
@@ -215,6 +223,13 @@ QQuickAnimatorJob::QQuickAnimatorJob()
m_isRenderThreadJob = true;
}
+void QQuickAnimatorJob::debugAnimation(QDebug d) const
+{
+ d << "QuickAnimatorJob(" << hex << (void *) this << dec
+ << ") state:" << state() << "duration:" << duration()
+ << "target:" << m_target << "value:" << m_value;
+}
+
qreal QQuickAnimatorJob::value() const
{
qreal v;
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 50481d4312..1cffae17db 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -74,6 +74,7 @@ public:
protected:
void updateCurrentTime(int);
void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState);
+ void debugAnimation(QDebug d) const Q_DECL_OVERRIDE;
public Q_SLOTS:
void windowChanged(QQuickWindow *window);
@@ -137,6 +138,7 @@ public:
protected:
QQuickAnimatorJob();
+ void debugAnimation(QDebug d) const Q_DECL_OVERRIDE;
QQuickItem *m_target;
QQuickAnimatorController *m_controller;