Results 1 to 5 of 5

Thread: QButtonGroup::setButton(int) conversion

  1. #1
    Join Date
    Feb 2007
    Posts
    31
    Thanks
    11

    Post QButtonGroup::setButton(int) conversion

    Hello,

    I can't find how to convert the Qt3 method QButtonGroup::setButton(int) to Qt4. Qt3 docs say that it "Sets the selected toggle button to id." I'm looking at QButtonGroup topic in the Assistant, but I can't find what I want. In the "Porting to Qt 4" document they have the confusing entry:

    void QButtonGroup::setButton(int) Setter.

    without saying what "Setter" is. I was hoping for an entry like "use clickButton" instead.

    Thank you.

  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: QButtonGroup::setButton(int) conversion

    I think QButtonGroup::setId() is what you're after.

    Oh, and "setter" is a "method that sets a value" contrary to a "getter" which is a "method that gets a value".

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

    JimBrown (8th March 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    31
    Thanks
    11

    Default Re: QButtonGroup::setButton(int) conversion

    Quote Originally Posted by wysota View Post
    I think QButtonGroup::setId() is what you're after.

    Oh, and "setter" is a "method that sets a value" contrary to a "getter" which is a "method that gets a value".
    Thanks for the quick reply. I think that the value I want to set is "which button in a button group is now toggled."

    setId sets the id for a specified button, but it doesn't set a particular button in a group as clicked.

  5. #4
    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: QButtonGroup::setButton(int) conversion

    I see... in that case use QAbstractButton::setChecked(true) on the button you want to be pressed.

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

    JimBrown (8th March 2007)

  7. #5
    Join Date
    Feb 2007
    Posts
    31
    Thanks
    11

    Default Re: QButtonGroup::setButton(int) conversion

    Quote Originally Posted by wysota View Post
    I see... in that case use QAbstractButton::setChecked(true) on the button you want to be pressed.
    Got it. Thank you.

Similar Threads

  1. conversion from QString to const uint8 *
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2007, 13:14
  2. Reg - Conversion of Qt3 to Qt4
    By suresh in forum Qt Programming
    Replies: 10
    Last Post: 28th August 2006, 23:10
  3. conversion of color
    By Stephano in forum Qt Programming
    Replies: 5
    Last Post: 22nd May 2006, 11:56
  4. template parameter and conversion operator
    By bitChanger in forum General Programming
    Replies: 7
    Last Post: 21st April 2006, 15:36
  5. use libs under qt4
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 27th February 2006, 17:59

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.