8

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

Marc Mutz - mmutz
  • 24,485
  • 12
  • 80
  • 90
CrazyCoder
  • 2,465
  • 8
  • 36
  • 57

4 Answers4

16

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 );
André
  • 18,348
  • 6
  • 60
  • 74
13

use

QCheckBox::setChecked(false);
Raiv
  • 5,731
  • 1
  • 33
  • 51
0

Use following code,

QCheckButton chkbox; chkbox.setChecked( false );

Mr. Prabhu
  • 35
  • 1
  • 2
  • 12
0

use the ui class of your main-window to get the icon action and uncheck it, eg.

ui->actionDraw_Polygon->setChecked(false);

ejectamenta
  • 1,047
  • 17
  • 20