Way to do radio buttons in Qt 4.4.3 menus

Way to do radio buttons in Qt 4.4.3 menus

Asked on January 9, 2019 in Qt.
Add Comment


  • 1 Answer(s)

    Use the QtActionGroup to menu items and look like an radio button as:

    QActionGroup* group = new QActionGroup( this );
     
    ui->actionTest1->setCheckable(true);
    ui->actionTest2->setCheckable(true);
    ui->actionTest3->setCheckable(true);
     
    ui->actionTest1->setActionGroup(group);
    ui->actionTest2->setActionGroup(group);
    ui->actionTest3->setActionGroup(group);
    

    For more details click this link : QActionGroup Class Reference

    Answered on January 9, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.