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. A map of QStandardItemModel or QTablView
Forum Updated to NodeBB v4.3 + New Features

A map of QStandardItemModel or QTablView

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 968 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.
  • K Offline
    K Offline
    karim24
    wrote on last edited by
    #1

    i want to store tableviews in a map which way is better to keep all the information about the table
    like (rowcounts,values in the cells,h/v headerlabels,.....)
    should i do this
    @QMap<QString,QStandardItemModel*> tables;@
    or
    @QMap<QString,QTableView*> tables;@
    or
    maybe a whole other way

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      The table information should be within your model, not your view. Your view is just a "dumb" view widget that doesn't hold the represented data itself. However if you have multiple views that work differently (on the same model?) you could use the qmap<QString, QTableView*>. On the other hand, what does the QString hold? Isn't a simple QList<QTableView> not more easy?

      Greetz, Jeroen

      1 Reply Last reply
      0
      • K Offline
        K Offline
        karim24
        wrote on last edited by
        #3

        hi,thanks for the reply
        the QString will hold the table's name,i need to reserve each table and it's
        name "like a tag" for save/open,and in searching for a certain table
        so,if there is a better way to that,that you know of, let me know

        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