Pergunta

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

Foi útil?

Solução

use

QCheckBox::setChecked(false);

Outras dicas

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 );

Use following code,

QCheckButton chkbox; chkbox.setChecked( false );

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

ui->actionDraw_Polygon->setChecked(false);

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top