Results 1 to 8 of 8

Thread: Automatic Resizing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Automatic Resizing

    Anybody have any ideas why the layouts aren't allowing me to automatically resize? Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Automatic Resizing

    I have messed around with the QSizePolicy of the widgets and the resizeMode of the layouts but cannot seem to get these to help me out any. The widgets still do not automatically resize even though they are inside the layouts. Thanks again for your help!

  3. #3
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Automatic Resizing

    I've edited your method slightly:

    Qt Code:
    1. bool MainWindow::createGUI
    2. {
    3. QFrame *mainFrame = new QFrame( this );
    4. // QWidget *layoutWidget = new QWidget( mainFrame );
    5. QVBoxLayout *mainLayout = new QVBoxLayout( /* layoutWidget */ mainFrame );
    6. ...
    7. }
    To copy to clipboard, switch view to plain text mode 

    Does it work now?
    Save yourself some pain. Learn C++ before learning Qt.

  4. The following user says thank you to Chicken Blood Machine for this useful post:

    ToddAtWSU (22nd January 2007)

  5. #4
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Automatic Resizing

    Thanks that seems to fix it. Why would having that middle widget hurt things? Thanks for your help!

  6. #5
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Automatic Resizing

    The middle widget doesn't hurt things, it's just unnecessary.

    What hurt things, was the fact that you did not apply a layout to the top level widget.
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. form not auto resizing
    By quickNitin in forum Newbie
    Replies: 5
    Last Post: 7th June 2007, 10:00
  2. QTabWidget - problem with resizing
    By moowy in forum Qt Programming
    Replies: 5
    Last Post: 14th September 2006, 14:06
  3. Problem with resizing dialog
    By Seema Rao in forum Qt Programming
    Replies: 8
    Last Post: 5th May 2006, 17:27
  4. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10
  5. Prevent from resizing a QMainWindow
    By Flier in forum Qt Tools
    Replies: 5
    Last Post: 14th April 2006, 17:11

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.