Q_PROPERTY(QVariantList sortCriteries WRITE setSortCriteries)
I am getting build warning:
warning : Property declaration sortCriteries has no READ accessor function or associated MEMBER variable. The property will be invalid.
I have tried replacing it with the keyword MEMBER but im getting error that MEMBER keyword is unknown or not recognized
Q_PROPERTY(QVariantList MEMBER sortCriteries WRITE setSortCriteries)
i dont want to make a READ or getter function as it has no use, any idea on how to approach this?
Im using 5.15, any idea?
CodePudding user response:
Your property declaration with MEMBER should look like this:
Q_PROPERTY(QVariantList sortCriteries MEMBER sortCriteriesMember WRITE setSortCriteries)
(Where sortCriteriesMember
is obviously the name of the member in your class, which can be different from the property name)
That said, if you only want to be able to write, you can also consider a Q_INVOKABLE:
Q_INVOKABLE void setSortCriteries(const QVariantList& value);