QmlDesigner.NodeInstances: Fixing enums for int properties

There is no easy way to convert an enum (e.g. Qt.Vertical) to the
integer value without the meta object/QMetaEnum.

For this reason we evluate the enum as an expression
if the target property is int.

Without this patch enums do not work at all for properties defined as int.
Change-Id: I9363a84eef1bf4a3ed2c40b35f7439e249e9bd98
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
Thomas Hartmann
2014-08-21 13:34:22 +02:00
parent 1a690d4b95
commit b6e6e0123c
2 changed files with 34 additions and 42 deletions
@@ -200,6 +200,7 @@ protected:
void addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty);
void deleteObjectsInList(const QQmlProperty &metaProperty);
QVariant convertSpecialCharacter(const QVariant& value) const;
QVariant convertEnumToValue(const QVariant &value, const PropertyName &name);
static QObject *parentObject(QObject *object);
static void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInstanceServer);
static QVariant enumationValue(const Enumeration &enumeration);