Results 1 to 5 of 5

Thread: best practices for large forms?

  1. #1
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default 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.)

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

    bajarangi (4th December 2010)

  4. #3
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: best practices for large forms?

    Thanks Lykurg - this is a topic that is not covered by any of the basic tutorials and examples.

  5. #4
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  6. The following 2 users say thank you to marcvanriet for this useful post:

    bajarangi (5th December 2010), crsn (22nd March 2011)

  7. #5
    Join Date
    Apr 2009
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: best practices for large forms?

    Very good reference. Promotion seems very useful - I have not checked it out yet.

Similar Threads

  1. Best practices concerning QStandardItemModel
    By tim47 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2010, 05:29
  2. Multiple Forms and vertical layout in forms
    By eva2002 in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2010, 05:05
  3. query about best practices
    By Raajesh in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 18:47
  4. Layouting "Windows.Forms" like Qt forms
    By Boron in forum Qt Tools
    Replies: 1
    Last Post: 29th April 2008, 22:01
  5. Sending large datagrams(very large)
    By marcel in forum General Programming
    Replies: 1
    Last Post: 16th February 2008, 21:55

Tags for this Thread

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.