Pivot table in QTreeView?

  • Hi All,

    Did anybody try to achieve pivot table in QTreeView/QAbstractTableModel?
    I would be happy if you would share how-tos. :)
    Maybe, with QSplitter???

    I have no idea at the moment.

    Many thanks in advance for your help.

  • Lifetime Qt Champion


    Do you mean having the tree view shown horizontally rather than vertically ?

  • @SGaist said in Pivot table in QTreeView?:
    Thanks for an update.
    Sorry, the initial information was wrong. I'm using QTableView, not QTreeView.

    Do you mean having the tree view shown horizontally rather than vertically ?

    Actually, I'm implementing a tableview, which is very similar to MS-Excel spread sheet, and it has a lot of number items both horizontally and vertically. (100 * 200 matrix)

    The first row and column item works as row's/column's header and the problem is that the matrix is too long to follow both horizontally and vertically. User can't map the item with the header(first row or column).
    SO,,,, what I want to achieve is to enable slider(s) but keep first row/column item visible wherever the user is viewing.


  • Lifetime Qt Champion

    Something like the Frozen Column Example ?

  • @SGaist Oh,, yes! Thanks for sharing a right approach!!
    My goal is something like this and it needs to be written in pyqt5.
    0_1515888162195_スクリーンショット 2018-01-14 9.02.06.png
    The headache parts are

    1. The upper left area where multiple QLabels and QPushButtons can be frozen
    2. Sort the Frozen Area 2 with View Port.

    I need some more time to understand this technique if it will work for my requirment. :)


Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.