Results 1 to 11 of 11

Thread: Multi-page application and QStackedWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Multi-page application and QStackedWidget

    I know object-oriented programming, probably I don't know so well, but I followed your advise and I searched in google but I didn't find nothing new.
    This multi-page application is not like a wizard-style sequence.
    At the moment I have two ideas/solution:

    Idea/solution n°1:
    -) One Form "MyForm" created using Designer where I put the QStackedWidget and create the GUI (so put in each pages the custom widget using Designer)
    -) One class "MainWindow" inherit from QMainWindow and from Ui::MyForm that deal the interaction between the QStackedWidget pages
    -) Thirty or more classes that deal the content of each page

    In this way I have only improved the legibility

    Idea/solution n°2:
    -)One Form "MyForm" created using Designer where I put the QStackedWidget
    -)One class "MainWindow" inherit from QMainWindow and from Ui::MyForm that deal the interaction between the QStackedWidget pages
    -)Thirty Form "PageXXXForm"one for each Page
    -)Thirty or more classes inherit from QWidget and Ui::PageXXXForm that deal the content of each page

    At the beginning the class "MainWindow" could create all the PageXXX object or only the 5-6 normally used and then create the other when necessary.
    But in this way I create a lot of classes one for each page.

    Probably solution n°2 is a good solution, but it is possible to do better?

    If someone has an idea or tell me where I made a mistake please tell me

    Thanks

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Multi-page application and QStackedWidget

    Frankly, 30 separate pages - each crammed with customized widgets - sounds hideously complex. I doubt I would bother trying to learn such a complicated interface unless there were some exceptionally good reason to do so.

    What, exactly, is this program supposed to do?

  3. #3
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Multi-page application and QStackedWidget

    I think that is the structure to create a lot of different GUI application.
    The start screen is full of custom push button (like the Iphone) pushing on them you could go to a specific page where you could go to another page/pages pushing other push button.
    So it is easy to have 30 pages.
    Obviously only 5-6 pages are often used and the other pages less.
    Every page has a lot of custom widget to create a personalized GUI application.
    I think that is important to understand the best way to do.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Multi-page application and QStackedWidget

    Quote Originally Posted by Mek82 View Post
    I know object-oriented programming.
    Good, then you will understand that the multiple inheritance approach you have chosen:
    -)One Form "MyForm" created using Designer where I put the QStackedWidget
    -)One class "MainWindow" inherit from QMainWindow and from Ui::MyForm that deal the interaction between the QStackedWidget pages
    -)Thirty Form "PageXXXForm"one for each Page
    -)Thirty or more classes inherit from QWidget and Ui::PageXXXForm that deal the content of each page
    is only one of several ways to incorporate Designer generated code into your application. You could equally chose the single inheritance approach and save some files. See "Using a Designer UI File in Your Application" in the Designer manual for more information. If you are using Qt Creator then you have options related to the method to use when creating a new UI class.

Similar Threads

  1. Replies: 7
    Last Post: 15th November 2012, 14:22
  2. multi page Application
    By ilpaso in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2010, 09:36
  3. A multi-windowed application with Qt
    By ouekah in forum Newbie
    Replies: 4
    Last Post: 13th April 2010, 15:44
  4. QStackedWidget page with different size
    By nina1983 in forum Qt Tools
    Replies: 1
    Last Post: 26th July 2008, 10:58
  5. Multi-Page PDF Output
    By igor in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2007, 04:10

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
  •  
Qt is a trademark of The Qt Company.