relate to qmlRegisterType
-
wrote on 15 Jul 2018, 11:34 last edited by aha_1980
qmlRegisterType<BackEnd>("io.qt.examples.backend", 1, 0, "BackEnd");can somebody specify what to give for the first parameter "io.qt.examples.backend" to register a class in QML and am getting error as qmlRegisterType is not declared in the scope
-
qmlRegisterType<BackEnd>("io.qt.examples.backend", 1, 0, "BackEnd");can somebody specify what to give for the first parameter "io.qt.examples.backend" to register a class in QML and am getting error as qmlRegisterType is not declared in the scope
@Monikarajendra said in relate to qmlREgisterType:
qmlRegisterType is not declared in the scope
You have to include the correct header.
#include <QQmlEngine>
can somebody specify what to give for the first parameter "io.qt.examples.backend"
While your issue has nothing to do with that URL, I'll still answer: it can be anything. Any string (well let's say any ascii alphanumeric string).
-
wrote on 15 Jul 2018, 15:31 last edited by
even after including that appropriate headerfile am still facing the same error
-
Hm that's unlikely. Is your BackEnd a qobject?
-
wrote on 15 Jul 2018, 17:06 last edited by
@Monikarajendra can you paste the exact error? Makes it much easier to find out the solution.
-
One more question: are you using Qt 4 by any chance?
2/6