Results 1 to 16 of 16

Thread: Set widget as central widget in a QMainWindow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2012
    Posts
    16
    Thanks
    9
    Platforms
    Windows

    Default Re: Set widget as central widget in a QMainWindow

    Most the objects in the example code does not have default parent objects
    What exactly does this mean?
    Are you refering to w1 and w2?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Set widget as central widget in a QMainWindow

    Yes, they should look like
    Qt Code:
    1. widget1 = new w1(this);
    2. widget2 = new w2(this);
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

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

    gtnoob (8th January 2013)

  4. #3
    Join Date
    Oct 2012
    Posts
    16
    Thanks
    9
    Platforms
    Windows

    Default Re: Set widget as central widget in a QMainWindow

    Does this ( http://qt-project.org/doc/qt-5.0/qtc...jecttrees.html ) explain the "because..." of your point of view?

  5. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Set widget as central widget in a QMainWindow

    Yes, I mean the same
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Replies: 2
    Last Post: 29th June 2011, 15:45
  2. QMainWindow central widget minimum size
    By dima in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2010, 07:24
  3. Replies: 2
    Last Post: 7th June 2008, 13:12
  4. paint central widget of a QMainWindow???
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 17th January 2007, 08:02
  5. Central Widget of QMainWindow
    By sumsin in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2006, 18:32

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.