Results 1 to 5 of 5

Thread: resize a QMainWindow

  1. #1
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default resize a QMainWindow

    Hi
    I have some frames inside a QMainWindow central widget.
    I want the window to auto resize as i show/hide the frames.
    How do i manage this? I tried sizepolicy but didn't work.
    Thanks

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: resize a QMainWindow

    not sure but .. u can try resizeEvent() ..
    "Behind every great fortune lies a crime" - Balzac

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

    graciano (16th August 2009)

  4. #3
    Join Date
    Nov 2007
    Posts
    103
    Thanks
    71
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: resize a QMainWindow

    I use this to resize widgets:
    Qt Code:
    1. QWidget::resize();
    To copy to clipboard, switch view to plain text mode 

    Check it out here:
    http://doc.trolltech.com/4.3/qwidget.html#size-prop
    Last edited by tommy; 16th August 2009 at 18:10.
    Use computer programming to do science!
    www.scienceprogramming.com

  5. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: resize a QMainWindow

    Set a proper layout to your central widget that contains the frames.
    It's nice to be important but it's more important to be nice.

  6. #5
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: resize a QMainWindow

    It's something like this: http://www.box.net/shared/57oakuculm

    It grows as i show new frames ... but it does not shrink back!

    What properties showld i be looking for?!

Similar Threads

  1. QMainWindow setCentralWidget from ui widget, Qt4
    By alan in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2008, 13:00
  2. Resize QWidget in QMainWindow
    By aamer4yu in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2007, 12:16
  3. QMainWindow resize problem
    By edb in forum Qt Programming
    Replies: 5
    Last Post: 12th January 2007, 10:31
  4. How to resize a QMainWindow in QWorkspace.
    By s_a_white in forum Newbie
    Replies: 2
    Last Post: 17th July 2006, 18:22
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.