Results 1 to 6 of 6

Thread: form not auto resizing

  1. #1
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default form not auto resizing

    this is in continuoation to post http://www.qtcentre.org/forum/f-newb...tton-4550.html

    Issue i am facing is auto resizing of this dialog.
    I have put these widget in a grid layout ( tried other layout also).
    I am wishing that my tab widgets remain of same size and whenever i try to display table widgets ,dialog form may enlarge/shorten correspondingily but this is not happening.
    I was expecing layout to take care of this. I also tried wih some some size policy but couldn't get desired result.

    quickNitin

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: form not auto resizing

    You are most likely missing the top level layout. Open up context menu over the dialog's background and select "Layout->Something" or alternatively do that from the Form-menu in the main menu bar (make sure you click on the dialogs background before so that no child widget is selected).
    J-P Nurmi

  3. #3
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: form not auto resizing

    widgets were already in grid layout and had done what you suggested. Ifound a example very similar to one i am doing except one line of code

    Qt Code:
    1. layout()->setSizeContraints(QLayout::setFixedSize)
    To copy to clipboard, switch view to plain text mode 

    This line did the trick. What i understood from this code layout manager allows only that much space which is minimum require. After that it expands / shrinks accordingly. Senior members kindly comment.
    Last edited by quickNitin; 23rd November 2006 at 10:14. Reason: grid missed

  4. #4
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: form not auto resizing

    Also if i donot follow the steps what u had suggested , this line results in segmentation fault since layout() for that widgets returns 0.

  5. #5
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: form not auto resizing

    Hi,
    I was struggling with this problem for the last 2 days and your posting has helped me a lot. But this SetFixedSize confused a bit, although it fixes the size of dialog box but also resizes it to the enclosing widget's size.

    Anju

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: form not auto resizing

    Quote Originally Posted by anju123 View Post
    But this SetFixedSize confused a bit, although it fixes the size of dialog box but also resizes it to the enclosing widget's size.
    What's the point of having a fixed size dialog that doesn't show all its content?

Similar Threads

  1. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 11:20
  2. form setting
    By mickey in forum Qt Tools
    Replies: 5
    Last Post: 27th September 2006, 00:28
  3. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 16:18
  4. .h file for each form in QT 3.3.5 project??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2006, 11:59
  5. Connecting slots/signals in subclassed form
    By qball2k5 in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2006, 16:01

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.