Qt Quick and Database
-
Dear all,
I'd like to create a simple app. It's just a form that reads data from a database and, somehow, it simply displays in some fancy way (that's why I choose Qt Quick)
The data within the database is structured in some relational tables: i.e. type, subtype, elements,...
The first hint I have is the data models "here":http://qt-project.org/doc/qt-4.8/qdeclarativemodels.html"
Next step would be connecting these data models to some SQL model. (QSqlQueryModel or similar). But I'm so stuck here.
So, any advice or example will be appreciated.
Thank you in advance.
-
Hi,
I think you must implement a C++ plugin for you QtQuick application in order to do this. You must create a Object that connect to database and use in you QtQuick Application.
-
there is a guide on how to implement QSQLTableModel in c++ and then publish it to QML
follow this post:
http://qt-project.org/forums/viewthread/12188and this one if you need a QSqlRelationalTableModel
http://qt-project.org/wiki/QML_and_QSqlTableModel
bye Andruj
-
I'll take a look at it. Thank you.