Re: Signal-slots connection problem.
Thanks jpn
In the earlier version of the program I used the button group so I am familiar with it.
I was able to put the buttons in a "group box" in designer, but it took up more screen height then with individual buttons and the 12 signal-slot are no problem.
Thanks anyway
Re: Signal-slots connection problem.
I'm starting to get the feeling that we are not understanding each other. We are talking about different things here.
In Qt3 QButtonGroup is a widget. In Qt4 it's not a widget nor nothing visible. It's just a concept of grouping any set of buttons together as a functionality. The buttons can even have different parents, and it has nothing to do with how the buttons are actually laid out.
The QButtonGroup example of mine was for Qt4. I wasn't talking about layouting or organizing the buttons in a form. I was talking about how to avoid those bunch of slots. It can be done with a single slot as the example was meant to present.
Re: Signal-slots connection problem.
Maybe we are. I was unable to find "button group" in your post. The only thing besides the text was two ?? in the upper left corner of the screen.
I'm a perverse old f... and not always wise, but you gave me good advise and some good information (can't use button groups in designer)
As an 80 old engineer my main thrust is setting up a standard user interface suitable for a wide range of programs where a new user, who knows his/her field, can learn to use it in a day or so. I would like to have all screen functions in the designer or not use the designer at all.
Thanks again, I really appreciate your help.
Re: Signal-slots connection problem.
This is the "example" I have been referring to:
Quote:
Originally Posted by
jpn
Code:
grp->addButton(ui.pb1, 1);
grp->addButton(ui.pb2, 2);
...
grp->addButton(ui.pb12, 12);
connect(grp, SIGNAL(buttonClicked(int)), this, SLOT(slotPb(int))
void PmForm::slotPb(int id)
{
ui.
leZone->setText
(QString("This is Pb%1").
arg(id
));
}
Many people (especially the ones switching from Qt3 to Qt4) tend to criticize Qt Designer. In my humble opinion it's just a great tool for it's purpose, designing GUI layouts. I guess the main reason for not including QButtonGroup in Designer is because it's not a widget but a functionality class. The Designer is for designing layouts, you code the functionality.
FAQ:
Quote:
Beginning with Qt4.0 Qt Designer seized to be an all-purpose development environment and became strictly a GUI Designer which can easily be incorporated into real IDEs like Visual Studio, Eclipse or KDevelop.
According to this poll, most people on this forum still seem to be happy with and using the Designer.
Anyway, there's a related entry in the Task Tracker: 126997 - Suggestion: QButtonGroup in Designer. Maybe in the future you can setup button groups from the Designer..
I'd say it's not about the age but the passion. You're not too old as long as you have any personal interest into programming. Of course amnesia and such might make it harder but... ;)
Re: Signal-slots connection problem.
Philosophical reasons aside, what is the real difference betwee the 12 + lines of code to build the button group and the 12 signal-slots?
Re: Signal-slots connection problem.
Quote:
Originally Posted by
jpn
I strongly doubt that (I haven't read the task-tracker entry though) as it will greatly limit the capabilities of the button group. Most people will not even look at the docs to see QButtonGroup is something more than what can be set from within Designer (i.e. adding buttons with different parents).
Quote:
Originally Posted by
impeteperry
what is the real difference betwee the 12 + lines of code to build the button group and the 12 signal-slots?
Clarity of code, speed of execution and sanity of the person maintaining the code. And besides that such solution is less error prone.
Re: Signal-slots connection problem.
Hi mysota
Understood
thanks