开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜