PDA

View Full Version : Read-only QCheckBox



alu23
22nd April 2008, 15:18
Hello,

how can I put a QCheckBox in read-only mode. Which means that the user can only read but not change the state of the box.
The application still has full control over the box.

How is that done in Qt?

Thanks in advance

Alu

marcel
22nd April 2008, 16:23
subclass QCheckBox, override mousePressEvent/mouseReleaseEvent and do nothing there.

^NyAw^
22nd April 2008, 16:25
Hi,

Also you can set it disabled and so, it will be showed as disabled but you can set it checked or unchecked by code.