QML 파일에서 다른 헤더에서 오는 enum을 사용하고 싶습니다. 열거가 묶여 있기 때문에qmlRegisterType with Q_ENUM 및 typedef enum
C:\Qt\5.7\msvc2013\include\QtQml\qqml.h:244: error: C2838: 'staticMetaObject' : illegal qualified name in member declaration
see reference to function template instantiation 'int qmlRegisterType<Test::Foobar>(const char *,int,int,const char *)' being compiled
그것을인가 : Q_ENUM로 포장 한 후, 나는 그것이 qmlRegisterType
와 함께 작동 할 수 없습니다 : MSVC 2013
와
class Test: public QObject
{
Q_OBJECT
typedef foo::bar Foobar; // bar is the enum, contained in a namespace foo
Q_ENUM(Foobar)
public:
static void declareQML()
{
qmlRegisterType<Foobar>("TestEnums", 1, 0, "Foobar");
};
}
을, 나는 다음과 같은 오류를 받고 있어요 네임 스페이스? 네임 스페이스와 enum (protobuf
에 의해 생성됨)을 포함하는 파일을 수정할 수는 없습니다.