artoon
artoon

Reputation: 739

Q_PROPERTY WRITE get index

I have this property:

Q_PROPERTY(int _a READ a WRITE setA NOTIFY aChanged)

I know only the property's name _a. I would like get the index of the method setA.

Upvotes: 1

Views: 364

Answers (1)

Silicomancer
Silicomancer

Reputation: 9166

Check out QMetaObject::indexOfProperty(const char * name) and QMetaProperty QMetaObject::property(int index). They will allow you to access the property by name.

AFAIK there is now way to access a setter method via the corresponding property.

Upvotes: 1

Related Questions