diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-07-06 18:44:00 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-07-08 11:27:38 -0300 |
commit | 1c4ee915c07daae9919e890072593b51e54c9aec (patch) | |
tree | 19424c508a942a202711fe65530894c10aaa7282 /libpyside/dynamicqmetaobject.h | |
parent | 693ae6d6c4073a483524af48e7a1a0ad1fba1131 (diff) |
Implemented support to properties on QMetaObject.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libpyside/dynamicqmetaobject.h')
-rw-r--r-- | libpyside/dynamicqmetaobject.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h index 69027f218..23a69c9a9 100644 --- a/libpyside/dynamicqmetaobject.h +++ b/libpyside/dynamicqmetaobject.h @@ -66,6 +66,23 @@ private: QSharedPointer<QByteArray> m_type; }; +class PropertyData +{ +public: + PropertyData(){} + PropertyData(const char*name, PyObject *data); + QByteArray name() const; + QByteArray type() const; + uint flags() const; + bool isValid() const; + bool operator==(const PropertyData& other) const; + bool operator==(const char* name) const; + +private: + QByteArray m_name; + PyObject* m_data; +}; + class PYSIDE_API DynamicQMetaObject : public QMetaObject { public: @@ -74,9 +91,11 @@ public: void addSignal(const char* signal, const char* type=0); void addSlot(const char* slot, const char* type=0); + void addProperty(const char* property, PyObject* data); void removeSignal(uint idex); void removeSlot(uint index); + void removeProperty(uint index); //Retrieve Python metadata to create QMetaObject (class name, signals, slot) static DynamicQMetaObject* createBasedOn(PyObject* obj, PyTypeObject* type, const QMetaObject* base); @@ -84,9 +103,11 @@ public: private: QLinkedList<MethodData> m_signals; QLinkedList<MethodData> m_slots; + QLinkedList<PropertyData> m_properties; QByteArray m_className; void updateMetaObject(); + void writeMethodsData(QLinkedList<MethodData>& methods, unsigned int **data, QList<QByteArray> *strings, int *index, int max_count, int null_index, int flags); }; PYSIDE_API inline void deleteDynamicQMetaObject(void* data) |