Skip to content
Qt 6.11 is out! See what's new in the release blog
  • Few Questions from beginner

    Qt in Education beginner databa qml listview
    5
    0 Votes
    5 Posts
    2k Views
    P
    Since you talked about QML I will assume that you work with embedded devices so SQLite is probably the database for you. Here is an example of how to connect to a database, hope this helps: QSqlDatabase db = QSqlDatabase::addDatabase("SQLITE"); db.setDatabaseName("path/to/database.db"); db.open(); //This will create the database if it doesent exist Make sure to include #include <QSqlDatabase> Also add QT += sql To your project file