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

One QHeaderView for multiple view



  • Hi,

    I have a widget with 2 view in vertical splitter.
    I would like to have a common HeaderView for both ( resizable ... )
    Unfortunally, when I plug a common headerview into both view using setHorizontalHeader, the header is displayed only on the second one.
    Do you have a solution ? Or maybe another GUI design pattern suggestion . The bottom view changes when an item is selected on the top view.

    6b97974e-45fd-4a34-98c8-9fa724c1e6a0-image.png


  • Moderators

    QHeaderView is a widget. You can't have one widget in two places at the same time.
    You can have two header views and sync them on change.