error: variable 'QQmlComponent component' has initializer but incomplete type in Qt5

后端 未结 2 598
说谎
说谎 2021-01-27 13:18

i am playing with Exposing Attributes of C++ Types to QML in Qt5 based on this tutor http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-exposecppattributes.html. when i

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-27 13:51

    You are not including QQmlComponent header in your main.cpp:

    #include 
    

    You are also trying to emit a signal that you haven't declared yet. You should declare it in your message.h like this:

    signals:
        void authorChanged();
    

    Check this example.

提交回复
热议问题