Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QTableView/QHeaderView behaviour with moveSection()



  • Hi,

    I have an application that is using a QTableView. The view displays some information from a database table. I wanted to move the last column in the view in front of the previous column so I used the QHeaderView::moveSection() function. The function moves the last row perfectly. The table is set to single selection mode and row selection behaviour.

    However, when a row is selected, the last column header is not highlighted (all the others are highlighted as well as the selected row header). I've managed to replicate this in a simple table as well (i.e. from a static model). It is possible to make the header display correctly by hovering the mouse pointer over the header or moving the application window. This behaviour does not occur if the column is not moved.

    Is there something I may be doing wrong or is this possibly a bug?

    I'm using Linux Mint x64 and Qt 3.5.1.

    Thanks,


  • Lifetime Qt Champion

    Hi,

    Sounds a bit fishy indeed. You should take a look at the "bug report system":http://bugreports.qt-project.org to see if it's something known. If not please consider opening a new report providing a minimal compilable example that reproduce the behavior.




Log in to reply