I have following QObject
:
#ifndef UETYPES
#define UETYPES
#include <QHash>
#include <QByteArray>
#include <QMultiMap>
#include <QString>
#include <QObject>
#include "../database/ueuserrecord.h"
#include "../database/ueorderrecord.h"
class UeTypes : public QObject
{
Q_OBJECT
public:
typedef QHash<int, QByteArray> UeTypeRoles;
/*
* QString first parameter userId
* QString second parameter placeId
*/
typedef QMultiMap<QString, QString> UeTypeLoggedUsers;
};
#endif // UETYPES
and I am trying to expose/export typedef QMultiMap<QString, QString> UeTypeLoggedUsers
to QML via qmlRegisterType
in main.cpp:
#include <QtQml>
#include <QApplication>
#include <QQmlApplicationEngine>
#include "core/uetypes.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<UeTypes::UeTypeLoggedUsers>("si.test",
1,
0,
"UeTypeLoggedUsers");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
However, when I try to compile this code, I get following error(s):
error: 'staticMetaObject' is not a member of 'QMultiMap'
Why am I getting this error and how do I get rid of it?