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] How to detect QTreeView has been re-sorted?
Qt 6.11 is out! See what's new in the release blog

[SOLVED] How to detect QTreeView has been re-sorted?

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

    I need to execute code after the tree view (my subclass of QTreeView) has been updated due to sorting changing - different sort column or direction selected by user (or otherwise).
    It seems that overriding

    @void QTreeViewsortByColumn(int column, Qt::SortOrder order)@

    would do the trick (I would execute my code after calling the parent's implementation), but sadly this method is not virtual. What can I do?

    P. S. This is why you make ALL the methods virtual in framework classes of this kind.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Violet Giraffe
      wrote on last edited by
      #2

      Found it. What I needed is

      @virtual void QSortFilterProxyModel::sort ( int column, Qt::SortOrder order = Qt::AscendingOrder )@

      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