Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtCreator doesn't accept Q_PROPERTY syntax with MEMBER keyword



  • Hello!

    As the title says, if I write the following code snipper in a C++ class, both QtCreator 2.7.2 (bundled with Qt5.1.0 final) and QtCreator2.8.0RC (built with Qt4.8.4) display the warning "expected )' beforeMEMBER'" on the line I declared the property and underlines it in red.

    Am I doing anything wrong or is it a bug?

    Here is my code:

    @class SH_InOutState : public QState
    {
    Q_OBJECT
    Q_PROPERTY(QString output MEMBER m_output NOTIFY outputChanged)

    public:
    SH_InOutState(QString output, QString name, QState *parent = 0);
    ...
    signals:
    void outputChanged();
    ...
    private:
    QString m_output;
    }@

    Thanks in advance for taking the time to have a look at this :-)



  • I second this question. I am facing the same problem.


  • Moderators

    If the code works, you are not doing anything wrong. Qt Creator probably does not know about this keyword yet.


Log in to reply