forked from qt-creator/qt-creator
QmlDesigner: Type of the propertyname is now PropertyName
And PropertyName is a typedef for QByteArray. Because we don't use the features of QString and the source would be cluttered with QLatin1Strings we changed the property name to QByteArray. Change-Id: Ib70ef136bbc411504b450456bd9bb705ae93dd25 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -55,7 +55,7 @@ BehaviorNodeInstance::Pointer BehaviorNodeInstance::create(QObject *object)
|
||||
return instance;
|
||||
}
|
||||
|
||||
void BehaviorNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void BehaviorNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
if (name == "enabled")
|
||||
return;
|
||||
@@ -63,7 +63,7 @@ void BehaviorNodeInstance::setPropertyVariant(const QString &name, const QVarian
|
||||
ObjectNodeInstance::setPropertyVariant(name, value);
|
||||
}
|
||||
|
||||
void BehaviorNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void BehaviorNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
if (name == "enabled")
|
||||
return;
|
||||
@@ -71,7 +71,7 @@ void BehaviorNodeInstance::setPropertyBinding(const QString &name, const QString
|
||||
ObjectNodeInstance::setPropertyBinding(name, expression);
|
||||
}
|
||||
|
||||
QVariant BehaviorNodeInstance::property(const QString &name) const
|
||||
QVariant BehaviorNodeInstance::property(const PropertyName &name) const
|
||||
{
|
||||
if (name == "enabled")
|
||||
return QVariant::fromValue(m_isEnabled);
|
||||
@@ -79,7 +79,7 @@ QVariant BehaviorNodeInstance::property(const QString &name) const
|
||||
return ObjectNodeInstance::property(name);
|
||||
}
|
||||
|
||||
void BehaviorNodeInstance::resetProperty(const QString &name)
|
||||
void BehaviorNodeInstance::resetProperty(const PropertyName &name)
|
||||
{
|
||||
if (name == "enabled")
|
||||
m_isEnabled = true;
|
||||
|
||||
@@ -45,12 +45,12 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
|
||||
|
||||
QVariant property(const QString &name) const;
|
||||
void resetProperty(const QString &name);
|
||||
QVariant property(const PropertyName &name) const;
|
||||
void resetProperty(const PropertyName &name);
|
||||
|
||||
private:
|
||||
bool m_isEnabled;
|
||||
|
||||
@@ -120,7 +120,7 @@ NodeInstanceMetaObject *NodeInstanceMetaObject::createNodeInstanceMetaObject(con
|
||||
return new NodeInstanceMetaObject(nodeInstance, engine);
|
||||
}
|
||||
|
||||
NodeInstanceMetaObject *NodeInstanceMetaObject::createNodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const QString &prefix, QQmlEngine *engine)
|
||||
NodeInstanceMetaObject *NodeInstanceMetaObject::createNodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const PropertyName &prefix, QQmlEngine *engine)
|
||||
{
|
||||
//Avoid setting up multiple NodeInstanceMetaObjects on the same QObject
|
||||
QObjectPrivate *op = QObjectPrivate::get(nodeInstance->object());
|
||||
@@ -175,7 +175,7 @@ NodeInstanceMetaObject::NodeInstanceMetaObject(const ObjectNodeInstance::Pointer
|
||||
|
||||
}
|
||||
|
||||
NodeInstanceMetaObject::NodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const QString &prefix, QQmlEngine *engine)
|
||||
NodeInstanceMetaObject::NodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const PropertyName &prefix, QQmlEngine *engine)
|
||||
: QQmlVMEMetaObject(object, cacheForObject(object, engine), vMEMetaDataForObject(object)),
|
||||
m_nodeInstance(nodeInstance),
|
||||
m_prefix(prefix),
|
||||
@@ -199,7 +199,7 @@ NodeInstanceMetaObject::~NodeInstanceMetaObject()
|
||||
|
||||
void NodeInstanceMetaObject::createNewProperty(const QString &name)
|
||||
{
|
||||
int id = createProperty(name.toLatin1(), 0);
|
||||
int id = createProperty(name.toUtf8(), 0);
|
||||
setValue(id, QVariant());
|
||||
Q_ASSERT(id >= 0);
|
||||
Q_UNUSED(id);
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
#include <private/qqmlopenmetaobject_p.h>
|
||||
#include <private/qqmlvmemetaobject_p.h>
|
||||
|
||||
#include "nodeinstanceglobal.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class ObjectNodeInstance;
|
||||
@@ -48,13 +51,13 @@ class NodeInstanceMetaObject : public QQmlVMEMetaObject
|
||||
{
|
||||
public:
|
||||
static NodeInstanceMetaObject *createNodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QQmlEngine *engine);
|
||||
static NodeInstanceMetaObject *createNodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const QString &prefix, QQmlEngine *engine);
|
||||
static NodeInstanceMetaObject *createNodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const PropertyName &prefix, QQmlEngine *engine);
|
||||
~NodeInstanceMetaObject();
|
||||
void createNewProperty(const QString &name);
|
||||
|
||||
protected:
|
||||
NodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QQmlEngine *engine);
|
||||
NodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const QString &prefix, QQmlEngine *engine);
|
||||
NodeInstanceMetaObject(const ObjectNodeInstancePointer &nodeInstance, QObject *object, const PropertyName &prefix, QQmlEngine *engine);
|
||||
|
||||
int openMetaCall(QMetaObject::Call _c, int _id, void **_a);
|
||||
int metaCall(QMetaObject::Call _c, int _id, void **_a);
|
||||
@@ -93,7 +96,7 @@ private:
|
||||
void init(QObject *, QQmlEngine *engine);
|
||||
|
||||
ObjectNodeInstanceWeakPointer m_nodeInstance;
|
||||
QString m_prefix;
|
||||
PropertyName m_prefix;
|
||||
QPointer<QQmlContext> m_context;
|
||||
QQmlOpenMetaObjectType *m_type;
|
||||
QScopedPointer<MetaPropertyData> m_data;
|
||||
|
||||
@@ -661,7 +661,7 @@ Internal::ChildrenChangeEventFilter *NodeInstanceServer::childrenChangeEventFilt
|
||||
return m_childrenChangeEventFilter.data();
|
||||
}
|
||||
|
||||
void NodeInstanceServer::addFilePropertyToFileSystemWatcher(QObject *object, const QString &propertyName, const QString &path)
|
||||
void NodeInstanceServer::addFilePropertyToFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path)
|
||||
{
|
||||
if (!m_fileSystemWatcherHash.contains(path)) {
|
||||
m_fileSystemWatcherHash.insert(path, ObjectPropertyPair(object, propertyName));
|
||||
@@ -669,7 +669,7 @@ void NodeInstanceServer::addFilePropertyToFileSystemWatcher(QObject *object, con
|
||||
}
|
||||
}
|
||||
|
||||
void NodeInstanceServer::removeFilePropertyFromFileSystemWatcher(QObject *object, const QString &propertyName, const QString &path)
|
||||
void NodeInstanceServer::removeFilePropertyFromFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path)
|
||||
{
|
||||
if (m_fileSystemWatcherHash.contains(path)) {
|
||||
fileSystemWatcher()->removePath(path);
|
||||
@@ -682,7 +682,7 @@ void NodeInstanceServer::refreshLocalFileProperty(const QString &path)
|
||||
if (m_fileSystemWatcherHash.contains(path)) {
|
||||
foreach (const ObjectPropertyPair &objectPropertyPair, m_fileSystemWatcherHash) {
|
||||
QObject *object = objectPropertyPair.first.data();
|
||||
QString propertyName = objectPropertyPair.second;
|
||||
PropertyName propertyName = objectPropertyPair.second;
|
||||
|
||||
if (hasInstanceForObject(object)) {
|
||||
instanceForObject(object).refreshProperty(propertyName);
|
||||
@@ -734,7 +734,7 @@ void NodeInstanceServer::resetInstanceProperty(const PropertyAbstractContainer &
|
||||
ServerNodeInstance instance = instanceForId(propertyContainer.instanceId());
|
||||
Q_ASSERT(instance.isValid());
|
||||
|
||||
const QString name = propertyContainer.name();
|
||||
const PropertyName name = propertyContainer.name();
|
||||
|
||||
if (activeStateInstance().isValid() && !instance.isSubclassOf("QtQuick/PropertyChanges")) {
|
||||
bool statePropertyWasReseted = activeStateInstance().resetStateProperty(instance, name, instance.resetVariant(name));
|
||||
@@ -755,7 +755,7 @@ void NodeInstanceServer::setInstancePropertyBinding(const PropertyBindingContain
|
||||
if (hasInstanceForId(bindingContainer.instanceId())) {
|
||||
ServerNodeInstance instance = instanceForId(bindingContainer.instanceId());
|
||||
|
||||
const QString name = bindingContainer.name();
|
||||
const PropertyName name = bindingContainer.name();
|
||||
const QString expression = bindingContainer.expression();
|
||||
|
||||
|
||||
@@ -789,7 +789,7 @@ void NodeInstanceServer::setInstancePropertyVariant(const PropertyValueContainer
|
||||
ServerNodeInstance instance = instanceForId(valueContainer.instanceId());
|
||||
|
||||
|
||||
const QString name = valueContainer.name();
|
||||
const PropertyName name = valueContainer.name();
|
||||
const QVariant value = valueContainer.value();
|
||||
|
||||
|
||||
@@ -816,8 +816,8 @@ void NodeInstanceServer::setInstancePropertyVariant(const PropertyValueContainer
|
||||
void NodeInstanceServer::setInstanceAuxiliaryData(const PropertyValueContainer &auxiliaryContainer)
|
||||
{
|
||||
//instanceId() == 0: the item is root
|
||||
if (auxiliaryContainer.instanceId() == 0 && (auxiliaryContainer.name() == QLatin1String("width") ||
|
||||
auxiliaryContainer.name() == QLatin1String("height"))) {
|
||||
if (auxiliaryContainer.instanceId() == 0 && (auxiliaryContainer.name() == "width" ||
|
||||
auxiliaryContainer.name() == "height")) {
|
||||
|
||||
if (!auxiliaryContainer.value().isNull()) {
|
||||
setInstancePropertyVariant(auxiliaryContainer);
|
||||
@@ -825,8 +825,8 @@ void NodeInstanceServer::setInstanceAuxiliaryData(const PropertyValueContainer &
|
||||
rootNodeInstance().resetProperty(auxiliaryContainer.name());
|
||||
}
|
||||
}
|
||||
if (auxiliaryContainer.name().endsWith(QLatin1String("@NodeInstance"))) {
|
||||
QString propertyName = auxiliaryContainer.name().leftRef(auxiliaryContainer.name().count() - 12).toString();
|
||||
if (auxiliaryContainer.name().endsWith("@NodeInstance")) {
|
||||
PropertyName propertyName = auxiliaryContainer.name().left(auxiliaryContainer.name().count() - 12);
|
||||
if (!auxiliaryContainer.value().isNull()) {
|
||||
setInstancePropertyVariant(PropertyValueContainer(auxiliaryContainer.instanceId(),
|
||||
propertyName,
|
||||
@@ -897,51 +897,51 @@ static QVector<InformationContainer> createInformationVector(const QList<ServerN
|
||||
informationVector.append(InformationContainer(instance.instanceId(), IsAnchoredByChildren, instance.isAnchoredByChildren()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), IsAnchoredBySibling, instance.isAnchoredBySibling()));
|
||||
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.fill"), instance.hasAnchor("anchors.fill")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.centerIn"), instance.hasAnchor("anchors.centerIn")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.right"), instance.hasAnchor("anchors.right")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.top"), instance.hasAnchor("anchors.top")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.left"), instance.hasAnchor("anchors.left")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.bottom"), instance.hasAnchor("anchors.bottom")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.horizontalCenter"), instance.hasAnchor("anchors.horizontalCenter")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.verticalCenter"), instance.hasAnchor("anchors.verticalCenter")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, QString("anchors.baseline"), instance.hasAnchor("anchors.baseline")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.fill"), instance.hasAnchor("anchors.fill")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.centerIn"), instance.hasAnchor("anchors.centerIn")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.right"), instance.hasAnchor("anchors.right")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.top"), instance.hasAnchor("anchors.top")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.left"), instance.hasAnchor("anchors.left")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.bottom"), instance.hasAnchor("anchors.bottom")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.horizontalCenter"), instance.hasAnchor("anchors.horizontalCenter")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.verticalCenter"), instance.hasAnchor("anchors.verticalCenter")));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.baseline"), instance.hasAnchor("anchors.baseline")));
|
||||
|
||||
QPair<QString, ServerNodeInstance> anchorPair = instance.anchor("anchors.fill");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.fill"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
QPair<PropertyName, ServerNodeInstance> anchorPair = instance.anchor("anchors.fill");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.fill"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.centerIn");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.centerIn"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.centerIn"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.right");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.right"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.right"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.top");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.top"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.top"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.left");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.left"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.left"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.bottom");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.bottom"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.bottom"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.horizontalCenter");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.horizontalCenter"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.horizontalCenter"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.verticalCenter");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.verticalCenter"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.verticalCenter"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
anchorPair = instance.anchor("anchors.baseline");
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, QString("anchors.baseline"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
informationVector.append(InformationContainer(instance.instanceId(), Anchor, PropertyName("anchors.baseline"), anchorPair.first, anchorPair.second.instanceId()));
|
||||
|
||||
QStringList propertyNames = instance.propertyNames();
|
||||
PropertyNameList propertyNames = instance.propertyNames();
|
||||
|
||||
if (initial) {
|
||||
foreach (const QString &propertyName,propertyNames)
|
||||
foreach (const PropertyName &propertyName,propertyNames)
|
||||
informationVector.append(InformationContainer(instance.instanceId(), InstanceTypeForProperty, propertyName, instance.instanceType(propertyName)));
|
||||
}
|
||||
|
||||
foreach (const QString &propertyName,instance.propertyNames()) {
|
||||
foreach (const PropertyName &propertyName,instance.propertyNames()) {
|
||||
bool hasChanged = false;
|
||||
bool hasBinding = instance.hasBindingForProperty(propertyName, &hasChanged);
|
||||
if (hasChanged)
|
||||
@@ -979,10 +979,10 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QList<
|
||||
QVector<PropertyValueContainer> valueVector;
|
||||
|
||||
foreach (const ServerNodeInstance &instance, instanceList) {
|
||||
foreach (const QString &propertyName, instance.propertyNames()) {
|
||||
foreach (const PropertyName &propertyName, instance.propertyNames()) {
|
||||
QVariant propertyValue = instance.property(propertyName);
|
||||
if (supportedVariantType(propertyValue.userType()))
|
||||
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString()));
|
||||
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, PropertyName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1005,13 +1005,13 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVecto
|
||||
QVector<PropertyValueContainer> valueVector;
|
||||
|
||||
foreach (const InstancePropertyPair &property, propertyList) {
|
||||
const QString propertyName = property.second;
|
||||
const PropertyName propertyName = property.second;
|
||||
const ServerNodeInstance instance = property.first;
|
||||
|
||||
if (instance.isValid()) {
|
||||
QVariant propertyValue = instance.property(propertyName);
|
||||
if (QMetaType::isRegistered(propertyValue.userType()) && supportedVariantType(propertyValue.type())) {
|
||||
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString()));
|
||||
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, PropertyName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1034,7 +1034,7 @@ QObject *NodeInstanceServer::dummyContextObject() const
|
||||
return m_dummyContextObject.data();
|
||||
}
|
||||
|
||||
void NodeInstanceServer::notifyPropertyChange(qint32 instanceid, const QString &propertyName)
|
||||
void NodeInstanceServer::notifyPropertyChange(qint32 instanceid, const PropertyName &propertyName)
|
||||
{
|
||||
if (hasInstanceForId(instanceid))
|
||||
addChangedProperty(InstancePropertyPair(instanceForId(instanceid), propertyName));
|
||||
|
||||
@@ -68,9 +68,9 @@ class NodeInstanceServer : public NodeInstanceServerInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef QPair<QPointer<QObject>, QString> ObjectPropertyPair;
|
||||
typedef QPair<QPointer<QObject>, PropertyName> ObjectPropertyPair;
|
||||
typedef QPair<qint32, QString> IdPropertyPair;
|
||||
typedef QPair<ServerNodeInstance, QString> InstancePropertyPair;
|
||||
typedef QPair<ServerNodeInstance, PropertyName> InstancePropertyPair;
|
||||
typedef QPair<QString, QPointer<QObject> > DummyPair;
|
||||
|
||||
explicit NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
||||
@@ -107,8 +107,8 @@ public:
|
||||
QFileSystemWatcher *fileSystemWatcher();
|
||||
QFileSystemWatcher *dummydataFileSystemWatcher();
|
||||
Internal::ChildrenChangeEventFilter *childrenChangeEventFilter() const;
|
||||
void addFilePropertyToFileSystemWatcher(QObject *object, const QString &propertyName, const QString &path);
|
||||
void removeFilePropertyFromFileSystemWatcher(QObject *object, const QString &propertyName, const QString &path);
|
||||
void addFilePropertyToFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path);
|
||||
void removeFilePropertyFromFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path);
|
||||
|
||||
QUrl fileUrl() const;
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
|
||||
ServerNodeInstance rootNodeInstance() const;
|
||||
|
||||
void notifyPropertyChange(qint32 instanceid, const QString &propertyName);
|
||||
void notifyPropertyChange(qint32 instanceid, const PropertyName &propertyName);
|
||||
|
||||
QStringList imports() const;
|
||||
QObject *dummyContextObject() const;
|
||||
|
||||
@@ -53,7 +53,7 @@ void NodeInstanceSignalSpy::setObjectNodeInstance(const ObjectNodeInstance::Poin
|
||||
|
||||
}
|
||||
|
||||
void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &prefix)
|
||||
void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const PropertyName &prefix)
|
||||
{
|
||||
if (m_registeredObjectList.contains(spiedObject)) // prevent cycles
|
||||
return;
|
||||
@@ -70,7 +70,7 @@ void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &
|
||||
&& QQmlMetaType::isQObject(metaProperty.userType())) {
|
||||
QObject *propertyObject = QQmlMetaType::toQObject(metaProperty.read(spiedObject));
|
||||
if (propertyObject)
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + QLatin1Char('.'));
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + '.');
|
||||
} else if (metaProperty.hasNotifySignal()) {
|
||||
QMetaMethod metaMethod = metaProperty.notifySignal();
|
||||
bool isConnecting = QMetaObject::connect(spiedObject, metaMethod.methodIndex(), this, methodeOffset, Qt::DirectConnection);
|
||||
@@ -86,7 +86,7 @@ void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &
|
||||
&& QQmlMetaType::isQObject(metaProperty.userType())) {
|
||||
QObject *propertyObject = QQmlMetaType::toQObject(metaProperty.read(spiedObject));
|
||||
if (propertyObject)
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + QLatin1Char('/'));
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + '/');
|
||||
}
|
||||
|
||||
// search recursive in objects list
|
||||
@@ -99,7 +99,7 @@ void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &
|
||||
for (int i = 0; i < list.count(); i++) {
|
||||
QObject *propertyObject = list.at(i);
|
||||
if (propertyObject)
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + QLatin1Char('/'));
|
||||
registerObject(propertyObject, prefix + metaProperty.name() + '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@
|
||||
#include <QHash>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "nodeinstanceglobal.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class ObjectNodeInstance;
|
||||
@@ -51,11 +54,11 @@ public:
|
||||
virtual int qt_metacall(QMetaObject::Call, int, void **);
|
||||
|
||||
protected:
|
||||
void registerObject(QObject *spiedObject, const QString &prefix = QString());
|
||||
void registerObject(QObject *spiedObject, const PropertyName &prefix = PropertyName());
|
||||
|
||||
private:
|
||||
int methodeOffset;
|
||||
QHash<int, QString> m_indexPropertyHash;
|
||||
QHash<int, PropertyName> m_indexPropertyHash;
|
||||
QObjectList m_registeredObjectList;
|
||||
ObjectNodeInstanceWeakPointer m_objectNodeInstance;
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ void ObjectNodeInstance::destroy()
|
||||
if (object()) {
|
||||
setId(QString());
|
||||
if (m_instanceId >= 0) {
|
||||
reparent(parentInstance(), m_parentProperty, ObjectNodeInstance::Pointer(), QString());
|
||||
reparent(parentInstance(), m_parentProperty, ObjectNodeInstance::Pointer(), PropertyName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ double ObjectNodeInstance::opacity() const
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::hasAnchor(const QString &/*name*/) const
|
||||
bool ObjectNodeInstance::hasAnchor(const PropertyName &/*name*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -250,9 +250,9 @@ bool ObjectNodeInstance::isAnchoredByChildren() const
|
||||
return false;
|
||||
}
|
||||
|
||||
QPair<QString, ServerNodeInstance> ObjectNodeInstance::anchor(const QString &/*name*/) const
|
||||
QPair<PropertyName, ServerNodeInstance> ObjectNodeInstance::anchor(const PropertyName &/*name*/) const
|
||||
{
|
||||
return qMakePair(QString(), ServerNodeInstance());
|
||||
return qMakePair(PropertyName(), ServerNodeInstance());
|
||||
}
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ static bool hasFullImplementedListInterface(const QQmlListReference &list)
|
||||
|
||||
static void removeObjectFromList(const QQmlProperty &property, QObject *objectToBeRemoved, QQmlEngine * engine)
|
||||
{
|
||||
QQmlListReference listReference(property.object(), property.name().toLatin1(), engine);
|
||||
QQmlListReference listReference(property.object(), property.name().toUtf8(), engine);
|
||||
|
||||
if (!hasFullImplementedListInterface(listReference)) {
|
||||
qWarning() << "Property list interface not fully implemented for Class " << property.property().typeName() << " in property " << property.name() << "!";
|
||||
@@ -303,7 +303,7 @@ static void removeObjectFromList(const QQmlProperty &property, QObject *objectTo
|
||||
listReference.append(object);
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldParent, const QString &oldParentProperty)
|
||||
void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty)
|
||||
{
|
||||
QQmlProperty property(oldParent, oldParentProperty, context());
|
||||
|
||||
@@ -322,7 +322,7 @@ void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldPare
|
||||
object->setParent(0);
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, const QString &newParentProperty)
|
||||
void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty)
|
||||
{
|
||||
QQmlProperty property(newParent, newParentProperty, context());
|
||||
|
||||
@@ -347,7 +347,7 @@ void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, c
|
||||
Q_ASSERT(objectToVariant(object).isValid());
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const QString &newParentProperty)
|
||||
void ObjectNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
if (oldParentInstance) {
|
||||
removeFromOldProperty(object(), oldParentInstance->object(), oldParentProperty);
|
||||
@@ -422,7 +422,7 @@ QVariant ObjectNodeInstance::fixResourcePaths(const QVariant &value)
|
||||
return value;
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
|
||||
@@ -457,7 +457,7 @@ void ObjectNodeInstance::setPropertyVariant(const QString &name, const QVariant
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void ObjectNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
|
||||
@@ -500,7 +500,7 @@ void ObjectNodeInstance::deleteObjectsInList(const QQmlProperty &property)
|
||||
list.clear();
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::resetProperty(const QString &name)
|
||||
void ObjectNodeInstance::resetProperty(const PropertyName &name)
|
||||
{
|
||||
doResetProperty(name);
|
||||
|
||||
@@ -511,7 +511,7 @@ void ObjectNodeInstance::resetProperty(const QString &name)
|
||||
doResetProperty("font.pixelSize");
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::refreshProperty(const QString &name)
|
||||
void ObjectNodeInstance::refreshProperty(const PropertyName &name)
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
|
||||
@@ -527,14 +527,14 @@ void ObjectNodeInstance::refreshProperty(const QString &name)
|
||||
|
||||
if (oldValue.type() == QVariant::Url) {
|
||||
QByteArray key = oldValue.toUrl().toEncoded(QUrl::UrlFormattingOption(0x100));
|
||||
QString pixmapKey = QString::fromLatin1(key.constData(), key.count());
|
||||
QString pixmapKey = QString::fromUtf8(key.constData(), key.count());
|
||||
QPixmapCache::remove(pixmapKey);
|
||||
}
|
||||
|
||||
property.write(oldValue);
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::hasBindingForProperty(const QString &name, bool *hasChanged) const
|
||||
bool ObjectNodeInstance::hasBindingForProperty(const PropertyName &name, bool *hasChanged) const
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
|
||||
@@ -549,7 +549,7 @@ bool ObjectNodeInstance::hasBindingForProperty(const QString &name, bool *hasCha
|
||||
return QQmlPropertyPrivate::binding(property);
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::doResetProperty(const QString &propertyName)
|
||||
void ObjectNodeInstance::doResetProperty(const PropertyName &propertyName)
|
||||
{
|
||||
m_modelAbstractPropertyHash.remove(propertyName);
|
||||
|
||||
@@ -597,7 +597,7 @@ void ObjectNodeInstance::doResetProperty(const QString &propertyName)
|
||||
}
|
||||
}
|
||||
|
||||
QVariant ObjectNodeInstance::property(const QString &name) const
|
||||
QVariant ObjectNodeInstance::property(const PropertyName &name) const
|
||||
{
|
||||
if (m_modelAbstractPropertyHash.contains(name))
|
||||
return QVariant::fromValue(m_modelAbstractPropertyHash.value(name));
|
||||
@@ -624,9 +624,9 @@ QVariant ObjectNodeInstance::property(const QString &name) const
|
||||
return property.read();
|
||||
}
|
||||
|
||||
QStringList allPropertyNames(QObject *object, const QString &baseName = QString(), QObjectList *inspectedObjects = new QObjectList)
|
||||
PropertyNameList allPropertyNames(QObject *object, const PropertyName &baseName = PropertyName(), QObjectList *inspectedObjects = new QObjectList)
|
||||
{
|
||||
QStringList propertyNameList;
|
||||
PropertyNameList propertyNameList;
|
||||
|
||||
|
||||
if (inspectedObjects== 0 || inspectedObjects->contains(object))
|
||||
@@ -643,28 +643,28 @@ QStringList allPropertyNames(QObject *object, const QString &baseName = QString(
|
||||
if (declarativeProperty.name() != "parent") {
|
||||
QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());
|
||||
if (childObject)
|
||||
propertyNameList.append(allPropertyNames(childObject, baseName + QString::fromUtf8(metaProperty.name()) + '.', inspectedObjects));
|
||||
propertyNameList.append(allPropertyNames(childObject, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
|
||||
}
|
||||
} else if (QQmlValueTypeFactory::valueType(metaProperty.userType())) {
|
||||
QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());
|
||||
valueType->setValue(metaProperty.read(object));
|
||||
propertyNameList.append(allPropertyNames(valueType, baseName + QString::fromUtf8(metaProperty.name()) + '.', inspectedObjects));
|
||||
propertyNameList.append(allPropertyNames(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
|
||||
} else {
|
||||
propertyNameList.append(baseName + QString::fromUtf8(metaProperty.name()));
|
||||
propertyNameList.append(baseName + PropertyName(metaProperty.name()));
|
||||
}
|
||||
}
|
||||
|
||||
return propertyNameList;
|
||||
}
|
||||
|
||||
QStringList ObjectNodeInstance::propertyNames() const
|
||||
PropertyNameList ObjectNodeInstance::propertyNames() const
|
||||
{
|
||||
if (isValid())
|
||||
return allPropertyNames(object());
|
||||
return QStringList();
|
||||
return PropertyNameList();
|
||||
}
|
||||
|
||||
QString ObjectNodeInstance::instanceType(const QString &name) const
|
||||
QString ObjectNodeInstance::instanceType(const PropertyName &name) const
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
if (!property.isValid())
|
||||
@@ -785,9 +785,9 @@ static void disableTiledBackingStore(QObject *object)
|
||||
Q_UNUSED(object);
|
||||
}
|
||||
|
||||
QStringList propertyNameForWritableProperties(QObject *object, const QString &baseName = QString(), QObjectList *inspectedObjects = new QObjectList())
|
||||
PropertyNameList propertyNameForWritableProperties(QObject *object, const PropertyName &baseName = PropertyName(), QObjectList *inspectedObjects = new QObjectList())
|
||||
{
|
||||
QStringList propertyNameList;
|
||||
PropertyNameList propertyNameList;
|
||||
|
||||
if (inspectedObjects == 0 || inspectedObjects->contains(object))
|
||||
return propertyNameList;
|
||||
@@ -802,16 +802,16 @@ QStringList propertyNameForWritableProperties(QObject *object, const QString &ba
|
||||
if (declarativeProperty.name() != "parent") {
|
||||
QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());
|
||||
if (childObject)
|
||||
propertyNameList.append(propertyNameForWritableProperties(childObject, baseName + QString::fromUtf8(metaProperty.name()) + '.', inspectedObjects));
|
||||
propertyNameList.append(propertyNameForWritableProperties(childObject, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
|
||||
}
|
||||
} else if (QQmlValueTypeFactory::valueType(metaProperty.userType())) {
|
||||
QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());
|
||||
valueType->setValue(metaProperty.read(object));
|
||||
propertyNameList.append(propertyNameForWritableProperties(valueType, baseName + QString::fromUtf8(metaProperty.name()) + '.', inspectedObjects));
|
||||
propertyNameList.append(propertyNameForWritableProperties(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
|
||||
}
|
||||
|
||||
if (metaProperty.isReadable() && metaProperty.isWritable()) {
|
||||
propertyNameList.append(baseName + QString::fromUtf8(metaProperty.name()));
|
||||
propertyNameList.append(baseName + PropertyName(metaProperty.name()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,9 +823,9 @@ static void fixResourcePathsForObject(QObject *object)
|
||||
if (qgetenv("QMLDESIGNER_RC_PATHS").isEmpty())
|
||||
return;
|
||||
|
||||
QStringList propertyNameList = propertyNameForWritableProperties(object);
|
||||
PropertyNameList propertyNameList = propertyNameForWritableProperties(object);
|
||||
|
||||
foreach (const QString &propertyName, propertyNameList) {
|
||||
foreach (const PropertyName &propertyName, propertyNameList) {
|
||||
QQmlProperty property(object, propertyName, QQmlEngine::contextForObject(object));
|
||||
|
||||
const QVariant value = property.read();
|
||||
@@ -1039,9 +1039,9 @@ void ObjectNodeInstance::deactivateState()
|
||||
|
||||
void ObjectNodeInstance::populateResetHashes()
|
||||
{
|
||||
QStringList propertyNameList = propertyNameForWritableProperties(object());
|
||||
PropertyNameList propertyNameList = propertyNameForWritableProperties(object());
|
||||
|
||||
foreach (const QString &propertyName, propertyNameList) {
|
||||
foreach (const PropertyName &propertyName, propertyNameList) {
|
||||
QQmlProperty property(object(), propertyName, QQmlEngine::contextForObject(object()));
|
||||
|
||||
QQmlAbstractBinding::Pointer binding = QQmlAbstractBinding::getPointer(QQmlPropertyPrivate::binding(property));
|
||||
@@ -1053,22 +1053,22 @@ void ObjectNodeInstance::populateResetHashes()
|
||||
}
|
||||
}
|
||||
|
||||
QQmlAbstractBinding *ObjectNodeInstance::resetBinding(const QString &propertyName) const
|
||||
QQmlAbstractBinding *ObjectNodeInstance::resetBinding(const PropertyName &propertyName) const
|
||||
{
|
||||
return m_resetBindingHash.value(propertyName).data();
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::hasValidResetBinding(const QString &propertyName) const
|
||||
bool ObjectNodeInstance::hasValidResetBinding(const PropertyName &propertyName) const
|
||||
{
|
||||
return m_resetBindingHash.contains(propertyName) && m_resetBindingHash.value(propertyName).data();
|
||||
}
|
||||
|
||||
QVariant ObjectNodeInstance::resetValue(const QString &propertyName) const
|
||||
QVariant ObjectNodeInstance::resetValue(const PropertyName &propertyName) const
|
||||
{
|
||||
return m_resetValueHash.value(propertyName);
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::setResetValue(const QString &propertyName, const QVariant &value)
|
||||
void ObjectNodeInstance::setResetValue(const PropertyName &propertyName, const QVariant &value)
|
||||
{
|
||||
m_resetValueHash.insert(propertyName, value);
|
||||
}
|
||||
@@ -1145,17 +1145,17 @@ void ObjectNodeInstance::createDynamicProperty(const QString &name, const QStrin
|
||||
m_metaObject->createNewProperty(name);
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::updateStateVariant(const ObjectNodeInstance::Pointer &/*target*/, const QString &/*propertyName*/, const QVariant &/*value*/)
|
||||
bool ObjectNodeInstance::updateStateVariant(const ObjectNodeInstance::Pointer &/*target*/, const PropertyName &/*propertyName*/, const QVariant &/*value*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::updateStateBinding(const ObjectNodeInstance::Pointer &/*target*/, const QString &/*propertyName*/, const QString &/*expression*/)
|
||||
bool ObjectNodeInstance::updateStateBinding(const ObjectNodeInstance::Pointer &/*target*/, const PropertyName &/*propertyName*/, const QString &/*expression*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ObjectNodeInstance::resetStateProperty(const ObjectNodeInstance::Pointer &/*target*/, const QString &/*propertyName*/, const QVariant &/*resetValue*/)
|
||||
bool ObjectNodeInstance::resetStateProperty(const ObjectNodeInstance::Pointer &/*target*/, const PropertyName &/*propertyName*/, const QVariant &/*resetValue*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
Pointer parentInstance() const;
|
||||
|
||||
virtual void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const QString &newParentProperty);
|
||||
virtual void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty);
|
||||
|
||||
virtual void setId(const QString &id);
|
||||
virtual QString id() const;
|
||||
@@ -112,8 +112,8 @@ public:
|
||||
|
||||
virtual int penWidth() const;
|
||||
|
||||
virtual bool hasAnchor(const QString &name) const;
|
||||
virtual QPair<QString, ServerNodeInstance> anchor(const QString &name) const;
|
||||
virtual bool hasAnchor(const PropertyName &name) const;
|
||||
virtual QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const;
|
||||
virtual bool isAnchoredBySibling() const;
|
||||
virtual bool isAnchoredByChildren() const;
|
||||
|
||||
@@ -123,17 +123,17 @@ public:
|
||||
virtual QPointF transformOriginPoint() const;
|
||||
virtual double zValue() const;
|
||||
|
||||
virtual void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const QString &name, const QString &expression);
|
||||
virtual QVariant property(const QString &name) const;
|
||||
virtual void resetProperty(const QString &name);
|
||||
virtual void refreshProperty(const QString &name);
|
||||
virtual QString instanceType(const QString &name) const;
|
||||
QStringList propertyNames() const;
|
||||
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
virtual QVariant property(const PropertyName &name) const;
|
||||
virtual void resetProperty(const PropertyName &name);
|
||||
virtual void refreshProperty(const PropertyName &name);
|
||||
virtual QString instanceType(const PropertyName &name) const;
|
||||
PropertyNameList propertyNames() const;
|
||||
|
||||
virtual QList<ServerNodeInstance> childItems() const;
|
||||
|
||||
void createDynamicProperty(const QString &name, const QString &typeName);
|
||||
void createDynamicProperty(const QString &PropertyName, const QString &typeName);
|
||||
void setDeleteHeldInstance(bool deleteInstance);
|
||||
bool deleteHeldInstance() const;
|
||||
|
||||
@@ -144,10 +144,10 @@ public:
|
||||
virtual void deactivateState();
|
||||
|
||||
void populateResetHashes();
|
||||
bool hasValidResetBinding(const QString &propertyName) const;
|
||||
QQmlAbstractBinding *resetBinding(const QString &propertyName) const;
|
||||
QVariant resetValue(const QString &propertyName) const;
|
||||
void setResetValue(const QString &propertyName, const QVariant &value);
|
||||
bool hasValidResetBinding(const PropertyName &propertyName) const;
|
||||
QQmlAbstractBinding *resetBinding(const PropertyName &propertyName) const;
|
||||
QVariant resetValue(const PropertyName &propertyName) const;
|
||||
void setResetValue(const PropertyName &propertyName, const QVariant &value);
|
||||
|
||||
QObject *object() const;
|
||||
|
||||
@@ -158,14 +158,14 @@ public:
|
||||
void setInPositioner(bool isInPositioner);
|
||||
virtual void refreshPositioner();
|
||||
|
||||
bool hasBindingForProperty(const QString &name, bool *hasChanged = 0) const;
|
||||
bool hasBindingForProperty(const PropertyName &name, bool *hasChanged = 0) const;
|
||||
|
||||
QQmlContext *context() const;
|
||||
QQmlEngine *engine() const;
|
||||
|
||||
virtual bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant &value);
|
||||
virtual bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QString &expression);
|
||||
virtual bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant &resetValue);
|
||||
virtual bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value);
|
||||
virtual bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QString &expression);
|
||||
virtual bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &resetValue);
|
||||
|
||||
|
||||
bool isValid() const;
|
||||
@@ -180,22 +180,22 @@ public:
|
||||
static QVariant fixResourcePaths(const QVariant &value);
|
||||
|
||||
protected:
|
||||
void doResetProperty(const QString &propertyName);
|
||||
void removeFromOldProperty(QObject *object, QObject *oldParent, const QString &oldParentProperty);
|
||||
void addToNewProperty(QObject *object, QObject *newParent, const QString &newParentProperty);
|
||||
void doResetProperty(const PropertyName &propertyName);
|
||||
void removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty);
|
||||
void addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty);
|
||||
void deleteObjectsInList(const QQmlProperty &metaProperty);
|
||||
QVariant convertSpecialCharacter(const QVariant& value) const;
|
||||
|
||||
private:
|
||||
QHash<QString, QVariant> m_resetValueHash;
|
||||
QHash<QString, QWeakPointer<QQmlAbstractBinding> > m_resetBindingHash;
|
||||
QHash<QString, ServerNodeInstance> m_modelAbstractPropertyHash;
|
||||
mutable QHash<QString, bool> m_hasBindingHash;
|
||||
QHash<PropertyName, QVariant> m_resetValueHash;
|
||||
QHash<PropertyName, QWeakPointer<QQmlAbstractBinding> > m_resetBindingHash;
|
||||
QHash<PropertyName, ServerNodeInstance> m_modelAbstractPropertyHash;
|
||||
mutable QHash<PropertyName, bool> m_hasBindingHash;
|
||||
qint32 m_instanceId;
|
||||
QString m_id;
|
||||
|
||||
QPointer<NodeInstanceServer> m_nodeInstanceServer;
|
||||
QString m_parentProperty;
|
||||
PropertyName m_parentProperty;
|
||||
bool m_deleteHeldInstance;
|
||||
QPointer<QObject> m_object;
|
||||
NodeInstanceMetaObject *m_metaObject;
|
||||
|
||||
@@ -47,7 +47,7 @@ bool PositionerNodeInstance::isResizable() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void PositionerNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void PositionerNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
if (name == "move" || name == "add" || name == "populate")
|
||||
return;
|
||||
@@ -55,7 +55,7 @@ void PositionerNodeInstance::setPropertyVariant(const QString &name, const QVari
|
||||
QuickItemNodeInstance::setPropertyVariant(name, value);
|
||||
}
|
||||
|
||||
void PositionerNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void PositionerNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
if (name == "move" || name == "add" || name == "populate")
|
||||
return;
|
||||
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
|
||||
bool isPositioner() const;
|
||||
|
||||
|
||||
@@ -61,14 +61,14 @@ QmlPropertyChangesNodeInstance::Pointer QmlPropertyChangesNodeInstance::create(Q
|
||||
return instance;
|
||||
}
|
||||
|
||||
void QmlPropertyChangesNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void QmlPropertyChangesNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
QMetaObject metaObject = QQuickPropertyChanges::staticMetaObject;
|
||||
|
||||
if (metaObject.indexOfProperty(name.toLatin1()) > 0) { // 'restoreEntryValues', 'explicit'
|
||||
if (metaObject.indexOfProperty(name) > 0) { // 'restoreEntryValues', 'explicit'
|
||||
ObjectNodeInstance::setPropertyVariant(name, value);
|
||||
} else {
|
||||
changesObject()->changeValue(name.toLatin1(), value);
|
||||
changesObject()->changeValue(name, value);
|
||||
QObject *targetObject = changesObject()->object();
|
||||
if (targetObject && nodeInstanceServer()->activeStateInstance().isWrappingThisObject(changesObject()->state())) {
|
||||
ServerNodeInstance targetInstance = nodeInstanceServer()->instanceForObject(targetObject);
|
||||
@@ -77,29 +77,29 @@ void QmlPropertyChangesNodeInstance::setPropertyVariant(const QString &name, con
|
||||
}
|
||||
}
|
||||
|
||||
void QmlPropertyChangesNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void QmlPropertyChangesNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
QMetaObject metaObject = QQuickPropertyChanges::staticMetaObject;
|
||||
|
||||
if (metaObject.indexOfProperty(name.toLatin1()) > 0) { // 'restoreEntryValues', 'explicit'
|
||||
if (metaObject.indexOfProperty(name) > 0) { // 'restoreEntryValues', 'explicit'
|
||||
ObjectNodeInstance::setPropertyBinding(name, expression);
|
||||
} else {
|
||||
changesObject()->changeExpression(name.toLatin1(), expression);
|
||||
changesObject()->changeExpression(name, expression);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant QmlPropertyChangesNodeInstance::property(const QString &name) const
|
||||
QVariant QmlPropertyChangesNodeInstance::property(const PropertyName &name) const
|
||||
{
|
||||
return changesObject()->property(name.toLatin1());
|
||||
return changesObject()->property(name);
|
||||
}
|
||||
|
||||
void QmlPropertyChangesNodeInstance::resetProperty(const QString &name)
|
||||
void QmlPropertyChangesNodeInstance::resetProperty(const PropertyName &name)
|
||||
{
|
||||
changesObject()->removeProperty(name.toLatin1());
|
||||
changesObject()->removeProperty(name);
|
||||
}
|
||||
|
||||
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const QString &oldParentProperty, const ServerNodeInstance &newParentInstance, const QString &newParentProperty)
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
changesObject()->detachFromState();
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
virtual void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const QString &name, const QString &expression);
|
||||
virtual QVariant property(const QString &name) const;
|
||||
virtual void resetProperty(const QString &name);
|
||||
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
virtual QVariant property(const PropertyName &name) const;
|
||||
virtual void resetProperty(const PropertyName &name);
|
||||
|
||||
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const QString &oldParentProperty, const ServerNodeInstance &newParentInstance, const QString &newParentProperty);
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
|
||||
|
||||
protected:
|
||||
QmlPropertyChangesNodeInstance(QQuickPropertyChanges *object);
|
||||
|
||||
@@ -99,7 +99,7 @@ bool QmlStateNodeInstance::isStateActive() const
|
||||
return stateObject() && stateGroup() && stateGroup()->state() == property("name");
|
||||
}
|
||||
|
||||
void QmlStateNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
bool hasParent = parent();
|
||||
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
|
||||
@@ -109,7 +109,7 @@ void QmlStateNodeInstance::setPropertyVariant(const QString &name, const QVarian
|
||||
ObjectNodeInstance::setPropertyVariant(name, value);
|
||||
}
|
||||
|
||||
void QmlStateNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void QmlStateNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
bool hasParent = parent();
|
||||
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
|
||||
@@ -119,19 +119,19 @@ void QmlStateNodeInstance::setPropertyBinding(const QString &name, const QString
|
||||
ObjectNodeInstance::setPropertyBinding(name, expression);
|
||||
}
|
||||
|
||||
bool QmlStateNodeInstance::updateStateVariant(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant &value)
|
||||
bool QmlStateNodeInstance::updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value)
|
||||
{
|
||||
return stateObject()->changeValueInRevertList(target->object(), propertyName.toLatin1(), value);
|
||||
return stateObject()->changeValueInRevertList(target->object(), QString::fromUtf8(propertyName), value);
|
||||
}
|
||||
|
||||
bool QmlStateNodeInstance::updateStateBinding(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QString &expression)
|
||||
bool QmlStateNodeInstance::updateStateBinding(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QString &expression)
|
||||
{
|
||||
return stateObject()->changeValueInRevertList(target->object(), propertyName.toLatin1(), expression);
|
||||
return stateObject()->changeValueInRevertList(target->object(), QString::fromUtf8(propertyName), expression);
|
||||
}
|
||||
|
||||
bool QmlStateNodeInstance::resetStateProperty(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant & /* resetValue */)
|
||||
bool QmlStateNodeInstance::resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant & /* resetValue */)
|
||||
{
|
||||
return stateObject()->removeEntryFromRevertList(target->object(), propertyName.toLatin1());
|
||||
return stateObject()->removeEntryFromRevertList(target->object(), QString::fromUtf8(propertyName));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -48,15 +48,15 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
|
||||
void activateState();
|
||||
void deactivateState();
|
||||
|
||||
bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant &value);
|
||||
bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QString &expression);
|
||||
bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const QString &propertyName, const QVariant &resetValue);
|
||||
bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value);
|
||||
bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QString &expression);
|
||||
bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &resetValue);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -59,7 +59,7 @@ bool QmlTransitionNodeInstance::isTransition() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlTransitionNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void QmlTransitionNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
if (name == "from" || name == "to")
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
|
||||
bool isTransition() const;
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ QRectF QuickItemNodeInstance::boundingRect() const
|
||||
return QRectF();
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void QuickItemNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
if (name == "state")
|
||||
return; // states are only set by us
|
||||
@@ -390,7 +390,7 @@ void QuickItemNodeInstance::setPropertyVariant(const QString &name, const QVaria
|
||||
parentInstance()->refreshPositioner();
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void QuickItemNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
if (name == "state")
|
||||
return; // states are only set by us
|
||||
@@ -405,7 +405,7 @@ void QuickItemNodeInstance::setPropertyBinding(const QString &name, const QStrin
|
||||
parentInstance()->refreshPositioner();
|
||||
}
|
||||
|
||||
QVariant QuickItemNodeInstance::property(const QString &name) const
|
||||
QVariant QuickItemNodeInstance::property(const PropertyName &name) const
|
||||
{
|
||||
return ObjectNodeInstance::property(name);
|
||||
}
|
||||
@@ -486,7 +486,7 @@ int QuickItemNodeInstance::penWidth() const
|
||||
return DesignerSupport::borderWidth(quickItem());
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::resetProperty(const QString &name)
|
||||
void QuickItemNodeInstance::resetProperty(const PropertyName &name)
|
||||
{
|
||||
if (name == "height") {
|
||||
m_hasHeight = false;
|
||||
@@ -536,7 +536,7 @@ void QuickItemNodeInstance::resetProperty(const QString &name)
|
||||
parentInstance()->refreshPositioner();
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const QString &newParentProperty)
|
||||
void QuickItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
if (oldParentInstance && oldParentInstance->isPositioner()) {
|
||||
setInPositioner(false);
|
||||
@@ -565,9 +565,9 @@ void QuickItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParen
|
||||
parentInstance()->refreshPositioner();
|
||||
}
|
||||
|
||||
static bool isValidAnchorName(const QString &name)
|
||||
static bool isValidAnchorName(const PropertyName &name)
|
||||
{
|
||||
static QStringList anchorNameList(QStringList() << "anchors.top"
|
||||
static PropertyNameList anchorNameList(PropertyNameList() << "anchors.top"
|
||||
<< "anchors.left"
|
||||
<< "anchors.right"
|
||||
<< "anchors.bottom"
|
||||
@@ -580,12 +580,12 @@ static bool isValidAnchorName(const QString &name)
|
||||
return anchorNameList.contains(name);
|
||||
}
|
||||
|
||||
bool QuickItemNodeInstance::hasAnchor(const QString &name) const
|
||||
bool QuickItemNodeInstance::hasAnchor(const PropertyName &name) const
|
||||
{
|
||||
return DesignerSupport::hasAnchor(quickItem(), name);
|
||||
}
|
||||
|
||||
QPair<QString, ServerNodeInstance> QuickItemNodeInstance::anchor(const QString &name) const
|
||||
QPair<PropertyName, ServerNodeInstance> QuickItemNodeInstance::anchor(const PropertyName &name) const
|
||||
{
|
||||
if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), name))
|
||||
return ObjectNodeInstance::anchor(name);
|
||||
@@ -593,7 +593,7 @@ QPair<QString, ServerNodeInstance> QuickItemNodeInstance::anchor(const QString &
|
||||
QPair<QString, QObject*> nameObjectPair = DesignerSupport::anchorLineTarget(quickItem(), name, context());
|
||||
|
||||
QObject *targetObject = nameObjectPair.second;
|
||||
QString targetName = nameObjectPair.first;
|
||||
PropertyName targetName = nameObjectPair.first.toUtf8();
|
||||
|
||||
if (targetObject && nodeInstanceServer()->hasInstanceForObject(targetObject)) {
|
||||
return qMakePair(targetName, nodeInstanceServer()->instanceForObject(targetObject));
|
||||
|
||||
@@ -78,18 +78,18 @@ public:
|
||||
bool isMovable() const;
|
||||
void setMovable(bool movable);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
|
||||
QVariant property(const QString &name) const;
|
||||
void resetProperty(const QString &name);
|
||||
QVariant property(const PropertyName &name) const;
|
||||
void resetProperty(const PropertyName &name);
|
||||
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const QString &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty);
|
||||
|
||||
int penWidth() const;
|
||||
|
||||
bool hasAnchor(const QString &name) const;
|
||||
QPair<QString, ServerNodeInstance> anchor(const QString &name) const;
|
||||
bool hasAnchor(const PropertyName &name) const;
|
||||
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const;
|
||||
bool isAnchoredBySibling() const;
|
||||
bool isAnchoredByChildren() const;
|
||||
void doComponentComplete();
|
||||
|
||||
@@ -246,7 +246,7 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
|
||||
return instance;
|
||||
}
|
||||
|
||||
void ServerNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const QString &oldParentProperty, const ServerNodeInstance &newParentInstance, const QString &newParentProperty)
|
||||
void ServerNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
m_nodeInstance->reparent(oldParentInstance.m_nodeInstance, oldParentProperty, newParentInstance.m_nodeInstance, newParentProperty);
|
||||
}
|
||||
@@ -303,35 +303,35 @@ QRectF ServerNodeInstance::boundingRect() const
|
||||
return boundingRect;
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setPropertyVariant(const QString &name, const QVariant &value)
|
||||
void ServerNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
m_nodeInstance->setPropertyVariant(name, value);
|
||||
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setPropertyDynamicVariant(const QString &name, const QString &typeName, const QVariant &value)
|
||||
void ServerNodeInstance::setPropertyDynamicVariant(const PropertyName &name, const TypeName &typeName, const QVariant &value)
|
||||
{
|
||||
m_nodeInstance->createDynamicProperty(name, typeName);
|
||||
m_nodeInstance->setPropertyVariant(name, value);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setPropertyBinding(const QString &name, const QString &expression)
|
||||
void ServerNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
|
||||
{
|
||||
m_nodeInstance->setPropertyBinding(name, expression);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setPropertyDynamicBinding(const QString &name, const QString &typeName, const QString &expression)
|
||||
void ServerNodeInstance::setPropertyDynamicBinding(const PropertyName &name, const TypeName &typeName, const QString &expression)
|
||||
{
|
||||
m_nodeInstance->createDynamicProperty(name, typeName);
|
||||
m_nodeInstance->setPropertyBinding(name, expression);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::resetProperty(const QString &name)
|
||||
void ServerNodeInstance::resetProperty(const PropertyName &name)
|
||||
{
|
||||
m_nodeInstance->resetProperty(name);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::refreshProperty(const QString &name)
|
||||
void ServerNodeInstance::refreshProperty(const PropertyName &name)
|
||||
{
|
||||
m_nodeInstance->refreshProperty(name);
|
||||
}
|
||||
@@ -345,17 +345,17 @@ void ServerNodeInstance::setId(const QString &id)
|
||||
\brief Returns the property value of the property of this NodeInstance.
|
||||
\returns QVariant value
|
||||
*/
|
||||
QVariant ServerNodeInstance::property(const QString &name) const
|
||||
QVariant ServerNodeInstance::property(const PropertyName &name) const
|
||||
{
|
||||
return m_nodeInstance->property(name);
|
||||
}
|
||||
|
||||
QStringList ServerNodeInstance::propertyNames() const
|
||||
PropertyNameList ServerNodeInstance::propertyNames() const
|
||||
{
|
||||
return m_nodeInstance->propertyNames();
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::hasBindingForProperty(const QString &name, bool *hasChanged) const
|
||||
bool ServerNodeInstance::hasBindingForProperty(const PropertyName &name, bool *hasChanged) const
|
||||
{
|
||||
return m_nodeInstance->hasBindingForProperty(name, hasChanged);
|
||||
}
|
||||
@@ -364,7 +364,7 @@ bool ServerNodeInstance::hasBindingForProperty(const QString &name, bool *hasCha
|
||||
\brief Returns the property default value of the property of this NodeInstance.
|
||||
\returns QVariant default value which is the reset value to
|
||||
*/
|
||||
QVariant ServerNodeInstance::defaultValue(const QString &name) const
|
||||
QVariant ServerNodeInstance::defaultValue(const PropertyName &name) const
|
||||
{
|
||||
return m_nodeInstance->resetValue(name);
|
||||
}
|
||||
@@ -372,7 +372,7 @@ QVariant ServerNodeInstance::defaultValue(const QString &name) const
|
||||
/*!
|
||||
\brief Returns the type of the property of this NodeInstance.
|
||||
*/
|
||||
QString ServerNodeInstance::instanceType(const QString &name) const
|
||||
QString ServerNodeInstance::instanceType(const PropertyName &name) const
|
||||
{
|
||||
return m_nodeInstance->instanceType(name);
|
||||
}
|
||||
@@ -404,7 +404,7 @@ bool ServerNodeInstance::isInPositioner() const
|
||||
return m_nodeInstance->isInPositioner();
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::hasAnchor(const QString &name) const
|
||||
bool ServerNodeInstance::hasAnchor(const PropertyName &name) const
|
||||
{
|
||||
return m_nodeInstance->hasAnchor(name);
|
||||
}
|
||||
@@ -424,7 +424,7 @@ bool ServerNodeInstance::isAnchoredByChildren() const
|
||||
return m_nodeInstance->isAnchoredByChildren();
|
||||
}
|
||||
|
||||
QPair<QString, ServerNodeInstance> ServerNodeInstance::anchor(const QString &name) const
|
||||
QPair<PropertyName, ServerNodeInstance> ServerNodeInstance::anchor(const PropertyName &name) const
|
||||
{
|
||||
return m_nodeInstance->anchor(name);
|
||||
}
|
||||
@@ -569,22 +569,22 @@ void ServerNodeInstance::deactivateState()
|
||||
m_nodeInstance->deactivateState();
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::updateStateVariant(const ServerNodeInstance &target, const QString &propertyName, const QVariant &value)
|
||||
bool ServerNodeInstance::updateStateVariant(const ServerNodeInstance &target, const PropertyName &propertyName, const QVariant &value)
|
||||
{
|
||||
return m_nodeInstance->updateStateVariant(target.internalInstance(), propertyName, value);
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::updateStateBinding(const ServerNodeInstance &target, const QString &propertyName, const QString &expression)
|
||||
bool ServerNodeInstance::updateStateBinding(const ServerNodeInstance &target, const PropertyName &propertyName, const QString &expression)
|
||||
{
|
||||
return m_nodeInstance->updateStateBinding(target.internalInstance(), propertyName, expression);
|
||||
}
|
||||
|
||||
QVariant ServerNodeInstance::resetVariant(const QString &propertyName) const
|
||||
QVariant ServerNodeInstance::resetVariant(const PropertyName &propertyName) const
|
||||
{
|
||||
return m_nodeInstance->resetValue(propertyName);
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::resetStateProperty(const ServerNodeInstance &target, const QString &propertyName, const QVariant &resetValue)
|
||||
bool ServerNodeInstance::resetStateProperty(const ServerNodeInstance &target, const PropertyName &propertyName, const QVariant &resetValue)
|
||||
{
|
||||
return m_nodeInstance->resetStateProperty(target.internalInstance(), propertyName, resetValue);
|
||||
}
|
||||
|
||||
@@ -117,13 +117,13 @@ public:
|
||||
double zValue() const;
|
||||
|
||||
double opacity() const;
|
||||
QVariant property(const QString &name) const;
|
||||
QVariant defaultValue(const QString &name) const;
|
||||
QString instanceType(const QString &name) const;
|
||||
QStringList propertyNames() const;
|
||||
QVariant property(const PropertyName &name) const;
|
||||
QVariant defaultValue(const PropertyName &name) const;
|
||||
QString instanceType(const PropertyName &name) const;
|
||||
PropertyNameList propertyNames() const;
|
||||
|
||||
|
||||
bool hasBindingForProperty(const QString &name, bool *hasChanged = 0) const;
|
||||
bool hasBindingForProperty(const PropertyName &name, bool *hasChanged = 0) const;
|
||||
|
||||
bool isValid() const;
|
||||
void makeInvalid();
|
||||
@@ -137,12 +137,12 @@ public:
|
||||
|
||||
bool isWrappingThisObject(QObject *object) const;
|
||||
|
||||
QVariant resetVariant(const QString &name) const;
|
||||
QVariant resetVariant(const PropertyName &name) const;
|
||||
|
||||
bool hasAnchor(const QString &name) const;
|
||||
bool hasAnchor(const PropertyName &name) const;
|
||||
bool isAnchoredBySibling() const;
|
||||
bool isAnchoredByChildren() const;
|
||||
QPair<QString, ServerNodeInstance> anchor(const QString &name) const;
|
||||
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const;
|
||||
|
||||
int penWidth() const;
|
||||
|
||||
@@ -163,27 +163,27 @@ public:
|
||||
private: // functions
|
||||
ServerNodeInstance(const QSharedPointer<Internal::ObjectNodeInstance> &abstractInstance);
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyDynamicVariant(const QString &name, const QString &typeName, const QVariant &value);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyDynamicVariant(const PropertyName &name, const TypeName &typeName, const QVariant &value);
|
||||
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyDynamicBinding(const QString &name, const QString &typeName, const QString &expression);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setPropertyDynamicBinding(const PropertyName &name, const TypeName &typeName, const QString &expression);
|
||||
|
||||
void resetProperty(const QString &name);
|
||||
void refreshProperty(const QString &name);
|
||||
void resetProperty(const PropertyName &name);
|
||||
void refreshProperty(const PropertyName &name);
|
||||
|
||||
void activateState();
|
||||
void deactivateState();
|
||||
void refreshState();
|
||||
|
||||
bool updateStateVariant(const ServerNodeInstance &target, const QString &propertyName, const QVariant &value);
|
||||
bool updateStateBinding(const ServerNodeInstance &target, const QString &propertyName, const QString &expression);
|
||||
bool resetStateProperty(const ServerNodeInstance &target, const QString &propertyName, const QVariant &resetValue);
|
||||
bool updateStateVariant(const ServerNodeInstance &target, const PropertyName &propertyName, const QVariant &value);
|
||||
bool updateStateBinding(const ServerNodeInstance &target, const PropertyName &propertyName, const QString &expression);
|
||||
bool resetStateProperty(const ServerNodeInstance &target, const PropertyName &propertyName, const QVariant &resetValue);
|
||||
|
||||
static ServerNodeInstance create(NodeInstanceServer *nodeInstanceServer, const InstanceContainer &instanceContainer, ComponentWrap componentWrap);
|
||||
|
||||
void setDeleteHeldInstance(bool deleteInstance);
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const QString &oldParentProperty, const ServerNodeInstance &newParentInstance, const QString &newParentProperty);
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
|
||||
|
||||
|
||||
void setId(const QString &id);
|
||||
|
||||
Reference in New Issue
Block a user