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. Data model and tableview (beginner)
Qt 6.11 is out! See what's new in the release blog

Data model and tableview (beginner)

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k Views 2 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.
  • LeandroAL Offline
    LeandroAL Offline
    LeandroA
    wrote on last edited by
    #1

    Hello there,

    I'm trying to write my first app in Qt using tableview. I looked into some tutorials but I found them confusing for a beginner like me. Please note I'm very beginner at C++ and Qt.
    What I understood is that to fill a tableview I need a data model.

    Can anyone give me a simple example on how to properly build a data model and insert/link it to a tableview, please?
    How do I add/remove items to it?

    I'm also not sure whether to use TableView or TableWidget. The goal is a table with contents that can be colored and clickable URLs on its cells. (in the future I may also need to put a combo box inside a cell)

    Thanks for any help

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

      Hi,

      You have to give more information about the kind of data you want to handle in your application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • LeandroAL Offline
        LeandroAL Offline
        LeandroA
        wrote on last edited by
        #3

        Thanks for answering!
        In the table it is regular text data: url, text, numbers and dates.

        1 Reply Last reply
        0
        • LeandroAL Offline
          LeandroAL Offline
          LeandroA
          wrote on last edited by
          #4

          Thank you all for the answers this Qt forum is friendly!

          Joel BodenmannJ 1 Reply Last reply
          0
          • LeandroAL LeandroA

            Thank you all for the answers this Qt forum is friendly!

            Joel BodenmannJ Offline
            Joel BodenmannJ Offline
            Joel Bodenmann
            wrote on last edited by
            #5

            I'd recommend you to read through this article first. That should give you a good overview about what is happening. After that you can start having a look at the various more advanced (and more complete) examples that are linked at the bottom of that article such as the address book example.

            Industrial process automation software: https://simulton.com
            Embedded Graphics & GUI library: https://ugfx.io

            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