Hmm.. I have a problem that I just can not figure out by myself. When I use your qdeclarativesettings.h and *.cpp files it complains about the <QDeclarativeProcess> in main.cpp file. Well, I found your qdeclarativeprocess.h and *.cpp files and that made it. However it now complains about "...\main.cpp:13: error: no matching function for call to 'qmlRegisterUncreatableType(const char [24], int, int, const char [10])'". Here's the main.cpp file: Code: #include <QtGui/QApplication> #include <QtDeclarative> #include "qmlapplicationviewer.h" #include "qdeclarativeprocess.h" #include "qdeclarativesettings.h" Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QApplication> app(createApplication(argc, argv)); QmlApplicationViewer viewer; qmlRegisterType<QDeclarativeProcess>("org.component.Processes", 1, 0, "Process"); qmlRegisterUncreatableType<QDeclarativeProcessEnums>("org.component.Processes", 1, 0, "Processes"); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/filecontrol/main.qml")); viewer.showExpanded(); return app->exec(); } If I try without the line it complains about (line 13: qmlRegisterUncreatableType<QDeclarativeProcessEnum s>) it works without any problems. Well, then it only displays onError statement in my *.qml file and not the onFinished state. Any advice what I'm doing wrong here? I have added *.cpp and *.h files in *.pro file so that should not be a problem.
#include <QtGui/QApplication> #include <QtDeclarative> #include "qmlapplicationviewer.h" #include "qdeclarativeprocess.h" #include "qdeclarativesettings.h" Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QApplication> app(createApplication(argc, argv)); QmlApplicationViewer viewer; qmlRegisterType<QDeclarativeProcess>("org.component.Processes", 1, 0, "Process"); qmlRegisterUncreatableType<QDeclarativeProcessEnums>("org.component.Processes", 1, 0, "Processes"); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/filecontrol/main.qml")); viewer.showExpanded(); return app->exec(); }
qmlRegisterUncreatableType<QDeclarativeProcessEnums>("org.component.Processes", 1, 0, "Processes", "Cannot be created in QML");