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. How to only display specific columns using QIdentityProxyModel
QtWS25 Last Chance

How to only display specific columns using QIdentityProxyModel

Scheduled Pinned Locked Moved Solved General and Desktop
qt5widgetstable modelproxy
2 Posts 1 Posters 435 Views
  • 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.
  • F Offline
    F Offline
    Folling
    wrote on last edited by
    #1

    I have a tableview with n columns, new columns can be added and removed dynamically.
    I now want to display that tableview, but only display two very specific columns (I do have the indices of those columns).

    I tried to set up proxy models to only return something valid for indicies of those columns, or to change columnCount but neither method worked - what am I missing?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Folling
      wrote on last edited by
      #2

      Just found out about QSortFilterProxyModel::filterAcceptsColumn which provides an integer for the column-index and hence suits my usecase perfectly. Still unsure why I couldn't get it to work with map(From/To)Source though

      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