qdbuscpp2xml: Support MEMBER field of Q_PROPERTY

Emit properties with MEMBER field specified with 'readwrite'
access. Previously only READ and WRITE filed where used
for deriving the access value.

Add a property using MEMBER to the test class used by
tst_qdbuscpp2xml.

Fixes: QTBUG-115631
Change-Id: I12351985a9fafd934ccc5e0b805077a9e44b6608
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Ievgenii Meshcheriakov 2023-08-02 14:34:03 +02:00
parent 3f3b2be870
commit 8d89b4ef21
2 changed files with 6 additions and 0 deletions

View File

@ -184,6 +184,8 @@ static QString generateInterfaceXml(const ClassDef *mo)
access |= 1;
if (!mp.write.isEmpty())
access |= 2;
if (!mp.member.isEmpty())
access |= 3;
int typeId = QMetaType::fromName(mp.type).id();
if (!typeId) {

View File

@ -17,6 +17,7 @@ class Test1 : public QObject
Q_CLASSINFO("D-Bus Interface", "org.qtProject.qdbuscpp2xmlTests.Test1")
Q_PROPERTY(int numProperty1 READ numProperty1 CONSTANT)
Q_PROPERTY(int numProperty2 READ numProperty2 WRITE setNumProperty2)
Q_PROPERTY(int numProperty3 MEMBER m_numProperty3)
Q_ENUMS(Salaries)
public:
// C++1y allows use of single quote as a digit separator, useful for large
@ -97,6 +98,9 @@ protected:
private:
Q_SCRIPTABLE void neverExported11() {}
Q_SCRIPTABLE int neverExported12() { return 42; }
private:
int m_numProperty3;
};
#endif