PDA

View Full Version : Q3ButtonGroup



Project25
10th April 2007, 22:05
I am having a problem with Q3ButtonGroup in my application. I have ported to qt4 and replaced all entries with Q3buttongroup and application builds fine. However I am not able to get buttons groups at all . For all individual button I am using QabstractButton.

Do I have to change anything else besides this after porting to Qt 4.


As mentioned in documention ,I am using button group following way:-
The button group is an invisible widget and the contained buttons have some other parent widget.I am inserting each button manually inserted using insert(), into the button group and through a given indentifier.

Please refer attached files for code snippet where i am trying to create buttons .

guilugi
11th April 2007, 10:49
Well,

QButtonGroup in Qt4 is no longer a widget containing buttons, it contains only indexed references to them.

Check the documentation : http://doc.trolltech.com/4.2/qbuttongroup.html

You can use QGroupbox to store visually your buttons, and if you need identifiers, use QButtonGroup in complement.

Project25
11th April 2007, 17:07
even Q3buttongroup will not work coz its in qt 3support libarary ?

guilugi
11th April 2007, 17:41
Sure, it will work, but you must see it as a temporary solution : those classes were meant to port quicky Qt3 apps to Qt4, but they don't have all the functionalities of equivalent Qt4 classes...

If you want your application to be stable, I highly recommend you to get rid of those support classes, and write pure Qt4 code.