Q_PROPERTY parse err for MEMBER QVariantList but not for other types
-
#include <QWizardPage> #include <QVariantList> namespace Ui { class Page4_students; } class Page4_students : public QWizardPage { Q_OBJECT public: Q_PROPERTY(qint32 test MEMBER m_test NOTIFY testChanged) Q_PROPERTY(QVariantList saddrs MEMBER m_saddrs NOFITY saddrsChanged) explicit Page4_students(QWidget *parent = nullptr); ~Page4_students(); signals: void saddrsChanged(); void testChanged(); private: qint32 m_test = 0; QVariantList m_saddrs; Ui::Page4_students *ui; }; #endif // PAGE4_STUDENTS_H
I'm getting
Parse error at "m_saddrs"
so I've created the test property and theqint32
is working just fime. I see examples ofQ_PROPERTY
withQVariantList
on the internet, why doesn't it work? -
Q_PROPERTY is usually placed in private section, but that is probably unrelated to your error.
Have you tried using
QList<QVariant>
instead ofQVariantList
? In some cases it works better. -
Q_PROPERTY is usually placed in private section, but that is probably unrelated to your error.
Have you tried using
QList<QVariant>
instead ofQVariantList
? In some cases it works better.@sierdzio I actually started with
QList<QVariant>
, also tried justQList
in the macro (I've read it's an alias). Anything else I could try? The macro was moved to public in my efforts to try everything, it doesn't work in private either... -
Ok, found it. NOTIFY, not NOFITY. Also, found it thanks to this:
https://bugreports.qt.io/browse/QTBUG-36367 -
Ok, found it. NOTIFY, not NOFITY. Also, found it thanks to this:
https://bugreports.qt.io/browse/QTBUG-36367@Szymon-M-Sabat said in Q_PROPERTY parse err for MEMBER QVariantList but not for other types:
Ok, found it. NOTIFY, not NOFITY. Also, found it thanks to this:
https://bugreports.qt.io/browse/QTBUG-36367Oh my goodness, of course, a typo. Well, thanks for sharing the solution :-) I'll be extra careful next time I see this error message.