I am working on a project in which there are 2 applications that communicate 
with each other, and they need to share some enums.

One of these apps is a Qt Quick 2 application, which is the user interface app. 
The other is a backend application which provides some data acquisition, etc.  
They may possibly run on different CPUs.

I am trying to share enums in a clean way between the apps by including the 
enum, but unfortunately, Qt Creator does not detect the enum in the included 
file.  Is there something I can do to make this work, so that if I type "Test." 
in Qt Creator Editor, it will give me the list of enum values from the included 
file?

#pragmaonce

#include<QObject>
#include<QtQml>

classTest:publicQObject{
    Q_OBJECT
    Q_ENUMS(ParameterId)

public:
    #include"TestParameters.h"

    explicitTest(QObject*parent=0);
    virtual~Test();
};

QML_DECLARE_TYPE(Test)

Note that if I instead place the enum at the location of the "#include 
TestParameters.h" rather than inside that included file, QtCreator will detect 
the enum and show it in auto-complete.
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to