Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Add checkbox to toolbar button
rizoritis last edited by
I have a custom vertical QToolBar in my application with custom buttons that I set images for. Instead of changing the image appearance for toggle buttons I would like to add a checkbox to the upper right-hand corner of each button to be checked when activated and unchecked when deactivated. I searched online to see if there were any examples or how to implement this, but came out unsuccessful. Does anyone know of a simple way to place a checkbox in the upper right corner of a button in my toolbar?
Jeroentjehome last edited by
Hi, You might just need to overwrite the default paintEvent and do it your self. there is a standard "checked" for a simple checkbox in front of the button.
jazzycamel last edited by
The "Commontk":http://www.commontk.org/ widget set includes a checkable button that might be adapted to your purposes:
The api is "here":http://www.commontk.org/docs/html/classctkCheckablePushButton.html and the source is "here":https://github.com/commontk/CTK/tree/master/Libs/Widgets.
Hope this helps ;o)