Results 1 to 5 of 5

Thread: A fixed size window?

  1. #1
    Join Date
    Jul 2007
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default A fixed size window?

    How to let a dialog or form have a FIXED size, I don't hope my enduser maximize or stretch my dialog or window. Boys, any ideas?
    Last edited by adorp; 23rd July 2007 at 19:21. Reason: spelling error

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [B]A fixed size window?[/B]

    Again : Qwidget::setFixedSize() Which under Designer expands to setting both min and max size to a given value (you may also want to set the size hint as fixed...)

    P.S : this very looks like double-thread to me (except for the smiley...)
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Jul 2007
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: A fixed size window?

    Thank you for the useful answer, really I appreciate your humour Incidentally, you're the toughest coder I've ever seen!

  4. #4
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Re: A fixed size window?

    If I may, an addition to this question:

    If I want a window to auto-size itself when it is created to the minimum size that everything will fit in, but not to be adjustable in size by the user how should I do that?

    I had been using this which is probably wrong:

    resize(sizeHint());
    setWindowFlags(Qt:ialog|Qt::MSWindowsFixedSizeDialogHint);

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A fixed size window?

    setFixedSize(sizeHint());
    or if you have a top layout:
    layout->setSizeConstraint(QLayout::Fixed);

    Regards

Similar Threads

  1. Restore the size of the window after minimize
    By SkripT in forum Qt Programming
    Replies: 10
    Last Post: 22nd September 2016, 17:23
  2. Qt Designer - Fixed size main form
    By nleverin in forum Newbie
    Replies: 3
    Last Post: 25th April 2008, 20:54
  3. QTableWidget columns to expand to window size
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 13th April 2007, 17:02
  4. Replies: 1
    Last Post: 9th February 2007, 10:41
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 23:14

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.