summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-02-06 18:08:36 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-02-07 08:25:42 +0000
commit9a371088d6b8e8a0986a30a8dfb0076669275103 (patch)
treeaf2173b9ae9d5abe1da6f9696e6279b734e3fbdf
parent7b8bcf437adcd0bb19e0209796cfbed770e9cd33 (diff)
Propagate Property attributes to the MetaObject
The attributes were ignored when a new Property was being add to the MetaObject. The addProperty method was only creating a new QProperty with the name and default values. The way of setting the attributes comes from: src/corelib/kernel/qmetaobjectbuilder.cpp specifically QMetaObjectBuilder::addProperty. Change-Id: Id81a274b3c2ae9d6b3413ebd54c776cefa392a38 Fixes: PYSIDE-924 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--sources/pyside2/libpyside/dynamicqmetaobject.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/sources/pyside2/libpyside/dynamicqmetaobject.cpp b/sources/pyside2/libpyside/dynamicqmetaobject.cpp
index b664e149..417ffef5 100644
--- a/sources/pyside2/libpyside/dynamicqmetaobject.cpp
+++ b/sources/pyside2/libpyside/dynamicqmetaobject.cpp
@@ -310,6 +310,17 @@ int MetaObjectBuilderPrivate::addProperty(const QByteArray &propertyName,
auto newProperty =
ensureBuilder()->addProperty(propertyName, property->d->typeName,
propertyNotifyId);
+ // Adding property attributes
+ newProperty.setReadable(PySide::Property::isReadable(property));
+ newProperty.setWritable(PySide::Property::isWritable(property));
+ newProperty.setResettable(PySide::Property::hasReset(property));
+ newProperty.setDesignable(PySide::Property::isDesignable(property));
+ newProperty.setScriptable(PySide::Property::isScriptable(property));
+ newProperty.setStored(PySide::Property::isStored(property));
+ newProperty.setUser(PySide::Property::isUser(property));
+ newProperty.setConstant(PySide::Property::isConstant(property));
+ newProperty.setFinal(PySide::Property::isFinal(property));
+
index = newProperty.index() + m_baseObject->propertyCount();
m_dirty = true;
return index;