QT - uncheck check box

CrazyCoder picture CrazyCoder · Dec 23, 2010 · Viewed 17.3k times · Source

Guys please let me know how to uncheck the check box using QT C++.

Answer

André picture André · Dec 23, 2010

You can use the setChecked() method from QAbstractButton.

QCheckButton b;
b.setChecked( false ); // Uncheck it

Alternatively you could use setCheckState() setCheckState() method from QCheckButton. This gives you the option to 'partially uncheck' it.

QCheckButton b;
b.setCheckState( Qt::Unchecked );