Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Solved: How to remove the tick of checkBox with code?



  • I want change a Qt window. And I need to remove the tick of check Box which indicates that the ceckBox is checked using my code.Thus I can reset the checkbox return to unchecked state.The code statements may look like the followed:

    if(ui->checkBox_HB->ischecked())
    {
    Here I want to make the checkbox return back to unchecked state.What sentence I can use here?

    }



  • setChecked



  • ui->checkBox_HB->setChecked(false);



  • [quote author="ankursaxena" date="1404793606"]ui->checkBox_HB->setChecked(false);
    [/quote]

    OK,it works well,and thank you very much ! I’m a freshman to study Qt by myself.I indeed have to read more materials about Qt assistance, maybe I can solve the problem by myself.



  • [quote author="sandy.martel" date="1404793502"]setChecked
    [/quote]

    OK, thank you very much ! I’m a freshman to study Qt by myself.I indeed have to read more materials about Qt assistance, I believe I can solve the problem by myself.



  • [quote author="Adam_wang" date="1404800096"]
    [quote author="sandy.martel" date="1404793502"]setChecked
    [/quote]

    OK, thank you very much ! I’m a freshman to study Qt by myself.I indeed have to read more materials about Qt assistance, I believe I can solve the problem by myself.[/quote]

    Great ! you can now edit your first post and append Solved to the title if this issue is resolved !.


Log in to reply