Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Want the toggle features and exclusive to user setting to one button, how to achieve this.

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

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 933 Views 1 Watching
  • 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 Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    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
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      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
      0
      • H Offline
        H Offline
        houmingc
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved