Results 1 to 3 of 3

Thread: How to make a QMainWindow fixed sized?

  1. #1
    Join Date
    Oct 2009
    Posts
    7
    Thanks
    1

    Default How to make a QMainWindow fixed sized?

    Hmm i can't seem to manage to find an elegant way of doing this... anyone have any ideeas?

  2. #2
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to make a QMainWindow fixed sized?

    Quote Originally Posted by Goldmmbr View Post
    Hmm i can't seem to manage to find an elegant way of doing this... anyone have any ideeas?
    Just call this function with your preferred size parameters.
    Qt Code:
    1. mainWindow->setFixedSize(200,200);
    To copy to clipboard, switch view to plain text mode 

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

    Goldmmbr (10th November 2009)

  4. #3
    Join Date
    Nov 2009
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to make a QMainWindow fixed sized?

    Just to expand on what yogeshgokul mentioned and if this helps...I believe you can also do

    Qt Code:
    1. mainWindow->setMaximumSize(200, 200);
    To copy to clipboard, switch view to plain text mode 

    and setMinimumSize() as well if needed depending on if you want the user to resize or minimize the window up to a certain point.

    If you are using QT Creator and a .ui you can easily access these and more by right clicking the window in the designer mode and going to the "Size Constraints" option and galore you have 6 options I believe.

    Hope this helps I'm kinda new hehe!

Similar Threads

  1. Replies: 2
    Last Post: 23rd March 2009, 17:26
  2. Replies: 1
    Last Post: 18th August 2008, 15:10
  3. Replies: 13
    Last Post: 12th June 2008, 13:23
  4. How to make headers fixed sized? (QTableWidget)
    By macias in forum Qt Programming
    Replies: 4
    Last Post: 13th August 2007, 15:57
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.