Commit 2165bd4d authored by Kai Koehne's avatar Kai Koehne
Browse files

QuickDesigner: Add debugging output to track State Switching

Of course disabled by default
parent d26e11b6
......@@ -461,6 +461,9 @@ void StatesEditorView::sceneChanged()
}
void StatesEditorView::startUpdateTimer(int i, int offset) {
if (debug)
qDebug() << __FUNCTION__ << i << offset;
if (i < 0 || i > m_modelStates.count())
return;
......
......@@ -39,6 +39,10 @@
#include <QDebug>
#include <QMessageBox>
enum {
debug = false
};
namespace QmlDesigner {
QmlModelView::QmlModelView(QObject *parent)
......@@ -235,12 +239,16 @@ QmlObjectNode QmlModelView::fxObjectNodeForId(const QString &id)
void QmlModelView::customNotification(const AbstractView * /* view */, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> & /* data */)
{
if (debug)
qDebug() << this << __FUNCTION__ << identifier << nodeList;
if (identifier == "__state changed__") {
QmlModelState state(nodeList.first());
if (state.isValid())
if (state.isValid()) {
activateState(state);
else
} else {
activateState(baseState());
}
}
}
......@@ -289,6 +297,8 @@ static bool isTransformProperty(const QString &name)
void QmlModelView::nodeInstancePropertyChanged(const ModelNode &node, const QString &propertyName)
{
if (debug)
qDebug() << this << __FUNCTION__ << node << propertyName;
QmlObjectNode qmlObjectNode(node);
......@@ -307,6 +317,9 @@ void QmlModelView::nodeInstancePropertyChanged(const ModelNode &node, const QStr
void QmlModelView::activateState(const QmlModelState &state)
{
if (debug)
qDebug() << this << __FUNCTION__ << state;
if (!state.isValid())
return;
......@@ -326,6 +339,9 @@ void QmlModelView::activateState(const QmlModelState &state)
void QmlModelView::changeToState(const ModelNode &node, const QString &stateName)
{
if (debug)
qDebug() << this << __FUNCTION__ << node << stateName;
QmlItemNode itemNode(node);
QmlModelState newState;
......@@ -355,8 +371,10 @@ void QmlModelView::otherPropertyChanged(const QmlObjectNode &/*qmlObjectNode*/,
{
}
void QmlModelView::stateChanged(const QmlModelState &/*newQmlModelState*/, const QmlModelState &/*oldQmlModelState*/)
void QmlModelView::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState)
{
if (debug)
qDebug() << this << __FUNCTION__ << oldQmlModelState << "to" << newQmlModelState;
}
} //QmlDesigner
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment