best practices for large forms?
I'm working on a gui that will eventually be pretty large. I've got a main window with tabbed interface, menus and toolbars. Using the "single inheritence" model if that matters.
Lately I've felt that I want to split up the ui form into multiple files, maybe one per tab.
I think this is possible, I just set the parent to each "page" widget to be the tab "page".
If this truly is possible, is it advisable?
Will I need to run "setupui" for each form in my c++ code, or just setup the main ui and then create each page widget? I have created some minor widgets in different forms and can place them into the appropriate parent form page, so I think it's possible on a larger level.
TIA,
baj
Re: best practices for large forms?
I would go that way if the pages becomes complex. One main ui with the tab widget and then multiple "QWidgtes" with the content of each tab. For them also use the single inheritence. Then you have two options:
You can put the pages by hand in the tab widget (in the cpp file of your main ui) or
add empty QWidgets in the designer to your tab widget and promote them to your own created page-classes.
You always can decide if you want a tab contend to be "outsourced" or not. So it is not necessarily a definite decision. (I normaly outsource all tabs if the dialog is otherwise too complicated.)
Re: best practices for large forms?
Thanks Lykurg - this is a topic that is not covered by any of the basic tutorials and examples.
Re: best practices for large forms?
Hi,
Someone asked a similar question some time ago. You may check out this thread : QStackedWidget-and-QTabWidget-Structure-Advice
Regards,
Marc
Re: best practices for large forms?
Very good reference. Promotion seems very useful - I have not checked it out yet.