
Originally Posted by
wysota
Please don't do that. You'll encounter more problems with it than benefits. Make proper subclasses from those widgets and either use the promote facility of Designer or add tabs to the tab widget manually. It's really worth it. Otherwise once you start writing some code logic you'll again have everything in one file.
I don't think you understand what I mean. This is what I mean:
[window.cpp]
tab1->Setup(tab1holder);
tab2->Setup(tab2holder);
[tab1.cpp]
ui->SetupUI(Parent);
connect(...)
connect(...)
}
... handlers for widgets in this tab ...
[window.cpp]
tab1->Setup(tab1holder);
tab2->Setup(tab2holder);
where tabXholder is a QWidget*
[tab1.cpp]
Tab::Tab(QWidget *Parent) {
ui->SetupUI(Parent);
connect(...)
connect(...)
}
... handlers for widgets in this tab ...
To copy to clipboard, switch view to plain text mode
Is this style of coding not advised?
I'm not sure how to subclass in designer when all you have is a group of controls in a widget with no container, or is the first thing you do supposed to be a container before you placed the controls?
Bookmarks