Results 1 to 4 of 4

Thread: Organizing program structure so that it is easy understandable

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    79
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    8

    Default Re: Organizing program structure so that it is easy understandable

    That's a bad idea. Each tab should be in each own class.
    I agree totally with you. I am just saying that if you use Qt Designer to build GUI, you get only one GUI class for all tabs when using QTabWidget. So there is a way to assign different classes to different tabs?
    I think that I must do following then:

    1. Make GUI class for each desired tab.
    2. Design GUI part of each class (can be done with Designer too).
    3. Then assign these GUI classes to each tabs (I think this must be done with code, because Designer doesnt support it).

    Am I correct here?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Organizing program structure so that it is easy understandable

    Quote Originally Posted by Tiansen View Post
    I agree totally with you. I am just saying that if you use Qt Designer to build GUI, you get only one GUI class for all tabs when using QTabWidget.
    No, that only happens if you do everything inside one form.

    So there is a way to assign different classes to different tabs?
    Yes, at least two such ways. One is to design each tab as a separate widget and then create a QTabWidget in manual written code and add those tabs to the widget there. The other is to make each of your pages a custom widget (either through plugins or by promoting the base class to the custom class) and make a form containing QTabWidget and place those custom widget as pages on the form. The first approach is better because you end up with a simpler hierarchy of objects.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. General: Structure of a Qt mainwindow program
    By kaizimir in forum Newbie
    Replies: 6
    Last Post: 7th September 2009, 19:33
  2. Some advice on how to structure this program?
    By mrwooster in forum Newbie
    Replies: 13
    Last Post: 12th August 2009, 15:24
  3. QTextEdit... was ->text() too easy?
    By Raccoon29 in forum Newbie
    Replies: 2
    Last Post: 16th March 2008, 17:58
  4. yet another easy task i cant figure out
    By sincnarf in forum Qt Programming
    Replies: 5
    Last Post: 16th October 2007, 06:46
  5. Organizing multiple threads
    By vratojr in forum Qt Programming
    Replies: 3
    Last Post: 25th May 2006, 10:53

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.