Commit 8ea077a3 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.nodeInstances: allow qDebug for InformationChangedCommand

parent a2518b6d
......@@ -66,4 +66,31 @@ QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command)
return in;
}
QDebug operator<<(QDebug debug, const InformationChangedCommand &command)
{
debug << QLatin1String("InformationChangedCommand:\n");
foreach (const InformationContainer &information, command.informations()) {
if (information.nameAsString() == "Transform" ||
information.nameAsString() == "IsMovable" ||
information.nameAsString() == "BoundingRect") {
debug << QLatin1String("instanceId: ");
debug << information.instanceId();
debug << QLatin1String("\n");
debug << QLatin1String("name: ");
debug << information.nameAsString();
debug << QLatin1String("\n");
debug << information.information();
debug << QLatin1String("\n");
debug << information.secondInformation();
debug << QLatin1String("\n");
debug << information.thirdInformation();
debug << QLatin1String("\n");
debug << QLatin1String("\n");
}
}
return debug;
}
} // namespace QmlDesigner
......@@ -35,6 +35,7 @@
#include <QMetaType>
#include <QVector>
#include <QDebug>
#include "informationcontainer.h"
......@@ -56,6 +57,7 @@ private:
QDataStream &operator<<(QDataStream &out, const InformationChangedCommand &command);
QDataStream &operator>>(QDataStream &in, InformationChangedCommand &command);
QDebug operator<<(QDebug debug, const InformationChangedCommand &command);
} // namespace QmlDesigner
......
......@@ -63,6 +63,47 @@ InformationName InformationContainer::name() const
return InformationName(m_name);
}
QString InformationContainer::nameAsString() const
{
switch (name()) {
case NoName:
return QLatin1String("NoName");
case Size:
return QLatin1String("Size");
case BoundingRect:
return QLatin1String("BoundingRect");
case Transform:
return QLatin1String("Transform");
case HasAnchor:
return QLatin1String("HasAnchor");
case Anchor:
return QLatin1String("Anchor");
case InstanceTypeForProperty:
return QLatin1String("InstanceTypeForProperty");
case PenWidth:
return QLatin1String("PenWidth");
case Position:
return QLatin1String("Position");
case IsInPositioner:
return QLatin1String("IsInPositioner");
case SceneTransform:
return QLatin1String("SceneTransform");
case IsResizable:
return QLatin1String("IsResizable");
case IsMovable:
return QLatin1String("IsMovable");
case IsAnchoredByChildren:
return QLatin1String("IsAnchoredByChildren");
case IsAnchoredBySibling:
return QLatin1String("IsAnchoredBySibling");
case HasContent:
return QLatin1String("HasContent");
case HasBindingForProperty:
return QLatin1String("HasBindingForProperty");
}
return QLatin1String("Unknown");
}
QVariant InformationContainer::information() const
{
return m_information;
......
......@@ -57,6 +57,7 @@ public:
qint32 instanceId() const;
InformationName name() const;
QString nameAsString() const;
QVariant information() const;
QVariant secondInformation() const;
QVariant thirdInformation() const;
......
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