I have problem finding the way to call model with relationships from main.cpp.
I have created the model/view library through QxEE but when i try to instantiate a class i get complier errors
Here is my main.cpp
- Code: Select all
#include "precompiled.h"
#include <QGuiApplication>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QxMemLeak.h>
#include <QQmlContext>
#include "export.h"
#include "tasks.gen.h"
#include "hourglassqx_precompiled_header.model_view.gen.h"
#include "hourglassqx_export.model_view.gen.h"
//#include "hourglassqx_all_include.model_view.gen.h"
#include "tasks.model_view.gen.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
qx::QxSqlDatabase::getSingleton()->setDriverName("QMYSQL");
qx::QxSqlDatabase::getSingleton()->setDatabaseName("hourglass_test");
qx::QxSqlDatabase::getSingleton()->setHostName("localhost");
qx::QxSqlDatabase::getSingleton()->setPort(3306);
qx::QxSqlDatabase::getSingleton()->setUserName("root");
qx::QxSqlDatabase::getSingleton()->setPassword("");
qx::IxModel* tModel= new qx::QxModel<model_view::tasks_model>;
tModel->qxFetchAll();
qAssert(tModel->rowCount()!=0);
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("taskModel",tModel);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
Is there anything wrong with the includes?
Thanks in advance