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. QTableView, frozen column

QTableView, frozen column

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 858 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.
  • T Offline
    T Offline
    thalle
    wrote on last edited by
    #1

    Hi,

    Struggling with a QTableView with frozen column implementation.

    It's pretty much a copy/paste of the Frozen Column Example in the documentation.

    My problem is that when the column is frozen the vertical scrolling does not sync with the main table.
    Especially when add, remove rows in the table (model), as well as setting filter to the model.

    Calling the updateFrozenTableGeometry() function in the example works when adding or removing rows. But not when setting filter.

    If i resize mainwindow the scrolling gets sync, and all works fine (until changing filter).

    Anyone with a solution?
    Some signal emitted during mainwindow resize obviously fix my problem, but which one. (update(), repaint() has be tested)

    Thx,
    T

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

      Hi,

      How exactly are you doing the filtering ?

      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
      • T Offline
        T Offline
        thalle
        wrote on last edited by
        #3

        QSqlRelationTableModel::setFilter()

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

          How are you freezing the column ?

          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
          • T Offline
            T Offline
            thalle
            wrote on last edited by
            #5

            As said : https://doc.qt.io/qt-5/qtwidgets-itemviews-frozencolumn-example.html

            I do not have the possibility to share my code.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              Are both table views in the frozen column setup are connected to the same QSqlRelationTableModel instance (correct), or have you connected them to two separate instances (not correct) ?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thalle
                wrote on last edited by
                #7

                Yes it's the same instance.

                I found an ugly fix I think I will go for. Due to struggling enough for now...
                When setting filter and frozen column option is active, I manually run hide() then show() on the frozen table view.

                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