Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can I make the QCheckBox label clickable?
Jakob last edited by Jakob
Normally when creating a
QCheckBoxwith a label, the label does not respond to clicks of the mouse.
Is there a simple way to let the checkbox respond to clicks on the labels instead of only responding to clicks exactly on the checkbox itself?
mostefa last edited by
Have you tried to create an inherited class from QCheckbox, and reimplement the mousePressEvent() Virtual Function?
Jakob last edited by
Nevermind - in the end it turned out the label was modeled as a separate
QLabelinstead of the
QCheckBox. Once I removed the label, and put the text inside the checkbox, I got exactly what I was asking for.