开发者

How to insert ToolButton with menu in the header of QTableWidget in QT

开发者 https://www.devze.com 2023-04-06 14:02 出处:网络
Can anybody please give me code to insert tool Button with menu开发者_运维技巧 in theheader of QTableWidget in QTYou\'ll have to make your own QHeaderView subclass that paints the QToolButton and hand

Can anybody please give me code to insert tool Button with menu开发者_运维技巧 in the header of QTableWidget in QT


You'll have to make your own QHeaderView subclass that paints the QToolButton and handles button presses, etc. You can then call myTableWidget->setHeader(instanceOfMyHeader) to use it in your QTableWidget.

Subclassing QHeaderView isn't exactly trivial. I've found a similar example that embeds a QCheckBox in the header, which can be found here. (Replace .cpp with .h for the c++ header)

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消