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!
精彩评论