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

Do I have to write my own TableView headerDelegate from scratch?



  • Using Qt 5.5, I've got a TableView where I need to tweak the header slightly - I want to set the font's point size and make it underlined.

    As far as I can tell, I can't just say "take the default headerDelegate and modify the font", my only option for doing this is to create my own headerDelegate and re-create the entire headerDelegate from scratch.

    1. Why isn't there a TableViewHeaderDelegate widget that I can "inherit" and just modify the font? Or is there, and I just don't know where to look?

    2. Is there an example somewhere showing how to get the UI for sorting to work?

    Thanks,
    Chris


  • Moderators

    @betty_crokker

    Why isn't there a TableViewHeaderDelegate widget that I can "inherit" and just modify the font? Or is there, and I just don't know where to look?

    There is no such way to do so. No such functionality provided yet.

    Is there an example somewhere showing how to get the UI for sorting to work?

    You can use the method described here. Basically it is a QML wrapper around QSortFilterProxyModel and works with ListModel.


Log in to reply