Results 1 to 4 of 4

Thread: Iterating over QGroupBox

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Iterating over QGroupBox

    I have a QGroupBox containing several QRadioButtons. How do I iterate over this group to get the QRadioButtons' "objectName" and "checked" value?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Iterating over QGroupBox


  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Iterating over QGroupBox

    The easiest way is to simply store pointers as member variables. However, you can use QObject::findChildren() or QLayout::itemAt() to access to the radio buttons still no pointers were stored. Yet another approach could be to make use of QButtonGroup or QSignalMapper to distinguish between the radio buttons.
    J-P Nurmi

  4. #4
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Iterating over QGroupBox

    Thank you.

Similar Threads

  1. Tab order ignored in QGroupBox
    By adskol in forum Newbie
    Replies: 2
    Last Post: 5th April 2010, 05:42
  2. Adding QGroupBox to QTabWidget
    By mclark in forum Newbie
    Replies: 2
    Last Post: 17th January 2007, 16:27
  3. QGroupBox Issues
    By ToddAtWSU in forum Qt Programming
    Replies: 8
    Last Post: 16th January 2007, 13:45
  4. QGroupBox title truncated on both sides
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2006, 15:02
  5. how to change QGroupBox frame color? (Qt4)
    By high_flyer in forum Qt Programming
    Replies: 7
    Last Post: 9th May 2006, 13:48

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.