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. [Solved]QStandardItemModel
Forum Updated to NodeBB v4.3 + New Features

[Solved]QStandardItemModel

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

    When I use this and shows the values in a QTableview it works fine BUT
    I uses five views in diffrent tabs and only want to show parts of the QSIM in the diffrent views.

    In the first view I got 3 rows and thats OK.
    In the second view I got 7 rows with values but I also got 3 empty Rows.

    And the next view I got 15 rows with values and 10 empty rows.

    It look likes the empty rows is the ones where i dont choose to show the values.

    Could i somhowe update the view or something.
    I dont want to have diffrent QSIM:s for each view.

    //T

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      It is hard to tell you what you are doing wrong without seeing any code, but my guess is that you are manipulating the model itself somehow for the different tabs?

      What you should do if you want to share a common model between the views, but have the views show different selections from the model, is to use a QSortFilterProxyModel between your QStandardItemModel and each of your views. So, you end up with as many QSFPM instances as you have views, but all of them operate on the same underlying model.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toho71
        wrote on last edited by
        #3

        Yes thats the answer.
        thanks

        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