Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
13 October 2021
One of the beautiful things about Qt's model/view framework is that headers are views, too. This means that changing the foreground color, the font, or any other properties for a single header cell is as easy as it is to change a cell in a table.
There is one feature missing though, namely, the possibility to have a checkbox in the header. That is what this video will fix.
"But why would you want that?" you ask. "Could you not just have the content of the header in the table itself and be done with it?"
You could, but then your header column would scroll away as you scroll your table.
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI