Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTreeView with Data from Database
Qt 6.11 is out! See what's new in the release blog

QTreeView with Data from Database

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 3.9k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I want to build a TreeView with Data from a Database and i have much Problems to code it. Anyone can tell me a good Database Structure for a TreeView?
    I followed this Tutorial, but i cant show anything in my TreeView. Maybe someone has a good Link to a Tutorial or Examplecode.
    http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      the SQL model is not good enough for your needs?
      http://doc.qt.io/qt-5/sql-model.html

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by A Former User
        #3

        i dont know here the first Time of it. How can i use it with TreeView and what Tablestructure i need?

        QAbstractProxyModel looks good too, but at the moment i have no idea how to implement it.

        mrjjM 1 Reply Last reply
        0
        • ? A Former User

          i dont know here the first Time of it. How can i use it with TreeView and what Tablestructure i need?

          QAbstractProxyModel looks good too, but at the moment i have no idea how to implement it.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Fuel
          start by reading about model and view
          http://doc.qt.io/qt-5/model-view-programming.html

          1 Reply Last reply
          1
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            I know the Model View Pattern. But its hard to understand how the Abstractitemmodel is working. But slowly step for step i make progress

            mrjjM 1 Reply Last reply
            1
            • ? A Former User

              I know the Model View Pattern. But its hard to understand how the Abstractitemmodel is working. But slowly step for step i make progress

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Fuel
              yes there is a lot of details when making your own model.
              the sqlmodel can already show the data from a db.
              there is also a table view for sql table.
              so I assume the normal SQL MODELS classes didnt not do as u wanted.

              1 Reply Last reply
              1

              • Login

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