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. Bug with QTableView QSortFilterProxyModel and hidden columns

Bug with QTableView QSortFilterProxyModel and hidden columns

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.5k 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.
  • B Offline
    B Offline
    Ben35
    wrote on last edited by
    #1

    Hello all,

    I'm having a problem with hidden columns on a table. I have a feature that can hide some columns of my table, using the table setColumnHidden function. I also have a QSortFilterProxyModel on this table that I use for hiding some rows according to a context. So I implemented the filterAcceptsRow function in my QSortFilterProxyModel. When my context changes, I call an invalidate on my QSortFilterProxyModel to hide some rows.

    My problem is that often (this is not a reproducible bug every time), the invalidate call shows the columns that were hidden!

    I specify that I do not have any particular threading. Everything is in the main thread.

    Someone would have an idea about this bug ?!

    Thank you.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      Strange bug.
      What's the source model? A custom one?
      The first thing I'd look at is if the source model either resets or the count of columns returns a number <= the index of the hidden column any time

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Ben35
        wrote on last edited by Ben35
        #3

        Yes, it's a custom source model too. There is no reset of the model. Column counts also valid.

        Edit : I also have the impression that the display of hidden columns is only done if row1 has been hidden by the invalidate. Really strange. I have the feeling that it is a Qt bug ... :(

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

          Hi,

          Can you reproduce that with a minimal compilable example ?

          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
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by Christian Ehrlicher
            #5

            When it happens with Qt5.9.4 or 5.10.0 (not sure about 5.10.1) then it's most likely QTBUG-65478

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            aha_1980A 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              When it happens with Qt5.9.4 or 5.10.0 (not sure about 5.10.1) then it's most likely QTBUG-65478

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Christian-Ehrlicher said in Bug with QTableView QSortFilterProxyModel and hidden columns:

              QTBUG-65478

              Most likely. For reference the complete link: https://bugreports.qt.io/browse/QTBUG-65478

              Qt has to stay free or it will die.

              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