Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Quick and Database
Forum Updated to NodeBB v4.3 + New Features

Qt Quick and Database

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Castorus
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      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.

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andruj
        wrote on last edited by
        #3

        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/12188

        and this one if you need a QSqlRelationalTableModel

        http://qt-project.org/wiki/QML_and_QSqlTableModel

        bye Andruj

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Castorus
          wrote on last edited by
          #4

          I'll take a look at it. Thank you.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved