Results 1 to 10 of 10

Thread: Difference between QWidget and QMainWindow

  1. #1
    Join Date
    May 2008
    Posts
    20
    Thanks
    1

    Default Difference between QWidget and QMainWindow

    When making a new form with the QT4 Designer, what is the difference between choosing QWidget and QMainWindow? They both seem to be a blank form that I can add buttons, etc to.

    Thanks,
    Dave

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Difference between QWidget and QMainWindow

    Is really that hard to read the docs?
    QMainWidow vs QWidget.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2008
    Posts
    20
    Thanks
    1

    Default Re: Difference between QWidget and QMainWindow

    Is it really that hard to either 1) answer politely or 2) not answer if you are annoyed with the question.

    I'll answer your question with another - Is it really that hard to make clear documentation and usable examples?

    Is the difference that a MainWindow has a menu/status/toolbar?

  4. #4
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4

    Default Re: Difference between QWidget and QMainWindow

    Quote Originally Posted by high_flyer View Post
    Is really that hard to read the docs?
    QMainWidow vs QWidget.
    Is it really that hard to post links correctly?

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Difference between QWidget and QMainWindow

    1. I was polite, AND added the information.
    2. There are very few (none that I know of) frameworks/kits with better documentation than Qt, for sure for such questions as whats the difference is between two widgets. Read the documentation of each widget and you will know the difference.
    3. The links are indeed broken, due to a typo - so kill me for offering the info.

    Comm'on, what do expect as answer to such a question?
    The answer is given in the documentation, all you have to do it RTFM!

    And you are lashing out for me pointing this out??

    What ever.

    P.S
    have a read through the site guide lines, will save you and other the aggravation with such posts.
    Last edited by high_flyer; 10th February 2010 at 10:54.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Difference between QWidget and QMainWindow

    When making a new form with the QT4 Designer, what is the difference between choosing QWidget and QMainWindow? They both seem to be a blank form that I can add buttons, etc to.
    Either you didn't phrase your question properly, or as high_flyer said, you didnt read the docs ? If you see the docs, you will notice QMainWindow is inherited from QWidget and on the doc page of QMainWindow you can find the extra functions.
    So what exactly more differences you need to know ?

    Also problem with asking such questions is that people start posting their homework. And no one wud be interested to do others homework.

  7. The following user says thank you to aamer4yu for this useful post:

    prof.ebral (17th February 2010)

  8. #7
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4

    Default Re: Difference between QWidget and QMainWindow

    Quote Originally Posted by aamer4yu View Post
    Either you didn't phrase your question properly, or as high_flyer said, you didnt read the docs ? If you see the docs, you will notice QMainWindow is inherited from QWidget and on the doc page of QMainWindow you can find the extra functions.
    So what exactly more differences you need to know ?

    Also problem with asking such questions is that people start posting their homework. And no one wud be interested to do others homework.
    high_flyer - This is a good example of how to answer a question without being a dick and still get your point across.

    Is really that hard to read the docs?
    I was polite...
    We must live on different planets. Sarcasm is not polite. You obviously understand this since you were offended by the way I pointed out your broken links (the same way you answered the OP).
    Last edited by bandtank; 10th February 2010 at 16:05.

  9. #8
    Join Date
    Apr 2007
    Posts
    62
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Difference between QWidget and QMainWindow

    Quote Originally Posted by daviddoria View Post
    When making a new form with the QT4 Designer, what is the difference between choosing QWidget and QMainWindow? They both seem to be a blank form that I can add buttons, etc to.

    Thanks,
    Dave
    For what it's worth, I thought the answer from this StackOverflow's post answered your question quite well: https://stackoverflow.com/a/3302386/65313

    Good luck!

  10. #9
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Difference between QWidget and QMainWindow

    Did you realize that this thread is eight years old?

    Ginsengelf

  11. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Difference between QWidget and QMainWindow

    And so is the StackOverflow post and answer. Sometimes you have to just shake your head and wonder why people bring these old posts back from the grave.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. QWidget on QMainWindow
    By jayreddy in forum Qt Programming
    Replies: 4
    Last Post: 6th January 2010, 09:27
  2. switch a QWidget inside a QMainWindow to fullscreen
    By koenux in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2009, 22:25
  3. QMainWindow or QWidget start hidden?
    By marf in forum Qt Programming
    Replies: 2
    Last Post: 3rd December 2008, 18:23
  4. Resize QWidget in QMainWindow
    By aamer4yu in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2007, 13:16
  5. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 10:03

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.