Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Want the toggle features and exclusive to user setting to one button, how to achieve this.

    Mobile and Embedded
    2
    3
    727
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      houmingc last edited by

      I have 3 pushbutton.
      created by 'go to slots' and 'clicked()'.
      In the GUI, i set checkable and in the code, i check for ischecked()

      I add in below code and my toggle button features disappear. Help ! I want the toggle features and exclusive to user setting one button, how to achieve this.
      QButtonGroup* group =new QButtonGroup(this);
      group->addButton(ui->pushbutton1);
      group->addButton(ui->pushbutton2);
      group->addButton(ui->pushbutton3);
      group->exclusive(true);

      1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators last edited by

        Hi,

        @
        group->exclusive(true);
        @

        to make it exclusive use "setExclusive":http://qt-project.org/doc/qt-5/qbuttongroup.html#exclusive-prop and set it to true.

        157

        1 Reply Last reply Reply Quote 0
        • H
          houmingc last edited by

          Hi

          I have already group->exclusive(true);
          It affects the push button working properly. The clickable features disappear.
          Is it because i use "go to slot" clicked instead "go to slot" toggled(bool)"?

          I include my Group in my constructor.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post