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

How to only display specific columns using QIdentityProxyModel

Scheduled Pinned Locked Moved Solved General and Desktop
qt5widgetstable modelproxy
2 Posts 1 Posters 448 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 25 Nov 2019, 12:47 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 25 Nov 2019, 13:06 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

      1/2

      25 Nov 2019, 12:47

      • Login

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