Results 1 to 2 of 2

Thread: QGroupBox to QButtonGroup Conversion

  1. #1
    Join Date
    Sep 2017
    Posts
    23
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QGroupBox to QButtonGroup Conversion

    I have a QGroupBox which has 50 QRadioButtons. The radio buttons are added to the UI of the project. I want to progromatically convert the QGroupBox to QButtonGroup to get benefit of the functions that are found in the QButtonGroup. Is there any other way to do that conversion. If there is not, so how to add the 30 QRadioButton to the QButtonGroup other than use the addButton() function? It is not logic to make 50 addButton() function.
    thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGroupBox to QButtonGroup Conversion

    What benefits do you mean? You cannot 'convert' one to the other as they serve different purposes (QButtonGroup is not a widget). If all the radio buttons have the same parent, they should behave as if they were part of the same button group (that is they should be mutually exclusive).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Ahmed Abdellatif (24th August 2018)

Similar Threads

  1. QRadioButton and QButtonGroup
    By joseche in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2012, 13:45
  2. Can't add QButtonGroup to QGridLayout
    By migel in forum Newbie
    Replies: 1
    Last Post: 27th June 2011, 18:27
  3. How to add QButtongroup to Layout?
    By pospiech in forum Qt Programming
    Replies: 1
    Last Post: 27th April 2008, 14:22
  4. QButtonGroup usage?
    By Caius Aérobus in forum Qt Programming
    Replies: 4
    Last Post: 22nd April 2008, 08:38
  5. QButtonGroup::setButton(int) conversion
    By JimBrown in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2007, 16:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.