Results 1 to 3 of 3

Thread: how to set max or min height or width for main form

  1. #1
    Join Date
    Feb 2012
    Posts
    44
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question how to set max or min height or width for main form

    i am unable to set height and width for main form ..
    my code::
    QWidget wid(this); // here this reflects to main ui i.e main form
    wid.setMinimumHeight(250);
    wid.setMinimumWidth(250);

    the above code is not working ...
    what i hav to use

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to set max or min height or width for main form

    Which do you want to do?
    1. Set the current height and width (i.e. QWidget::resize()), or
    2. Set minimum allowable size (i.e QWidget::setMinimumSize() and friends).

    Setting the minimum size does not change the current size of the widget unless it it already smaller than the minimum.

  3. #3
    Join Date
    Feb 2012
    Posts
    44
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to set max or min height or width for main form

    Actually my aim is, if i double click on tree view ,if that file which i double clicked is with .jpg extension then i am showing that image on label, i want that ui to auto resize based on image height and width..

    i tried above one it din't work

Similar Threads

  1. Widget Height and Width
    By in_dbasu in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2011, 08:44
  2. Replies: 1
    Last Post: 25th February 2011, 11:46
  3. Fix proportion of width and height in QGridLayout
    By Wong in forum Qt Programming
    Replies: 6
    Last Post: 7th January 2011, 07:24
  4. QPushButton set width and height from StyleSheet
    By AL in forum Qt Programming
    Replies: 3
    Last Post: 19th March 2010, 14:33
  5. width and height of QTabWidget
    By chikkireddi in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 13:53

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.