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. Probably a simple question on sharing one model between two views

Probably a simple question on sharing one model between two views

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

    In this case, I am working with legacy code. I have a large deque data structure. This is the data source. I need two QTableView widgets on a single dialog that utilize the same data source but show different columns of data. Since each table displays different columns of data, how can they share the same QAbstractItemModel? Is this what proxy models are for?

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

      Hi,

      If it's only a question of showing specific columns, you don't event need a proxy. You can use "QTableView::setColumnHidden":http://qt-project.org/doc/qt-5/qtableview.html#setColumnHidden

      Hope it helps

      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

      • Login

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