Results 1 to 5 of 5

Thread: Resizing the dialog boxes

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

    Default Resizing the dialog boxes

    This problem has been bugging me for a long long time and everytime I find a working solution and moves on but after some time , the same problem again crops up in another dialog and once again I look for some other solution
    This is regarding the resizing of the dialog boxes according to the content of the widgets inside it. I got the solution on the same forum i.e use
    Qt Code:
    1. setSizeConstraint(QLayout::SetFixedSize)
    To copy to clipboard, switch view to plain text mode 
    but this was not liked by people as this solution does not allow then the user to resize the dialog box manually.
    Then I came to a conclusion that the widgets has to be on the main layout and you have to apply some layout to a dialog box and then only the widgets on the dialog will resize

    Another time a dialog box with a frame which was having the same problem, now agian back to finding the solution, this time I observed that in the existing file, the minimum size of the Frame was set to some value and as I remove the value and put the minimum size to (0,0) it was working as expected. And offcourse every frame and the dialog box need to have a layout.
    Now this is beyond my understanding that how come minimum size can restrict the frame from resizing. So can anyone please help in explaining this weird behaviour otherwise I know that once again another dialog box might come with a different kind of problem for resiziing.
    Thanks for reading such a long query :-)

  2. #2
    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: Resizing the dialog boxes

    Could you show us the respective ui file?

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

    Default Re: Resizing the dialog boxes

    certainly.
    The screenshots and the respective UI files
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    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: Resizing the dialog boxes

    First of all - why are you using Q3Frame here?

    Second of all - why did you use a frame at all? You could have used a layout here.

    Third of all - the behaviour you describe is caused by an incorrect use of size policies. The minimumSize has to be 0,0 so that it is ignored (you want to use the sizeHint as the size control mechanism). Then you can adjust size policy of the container you wish to be controled by the size of its contents (in your case the Q3Frame) to alter the behaviour.

    Attached is a corrected ui file that simplifies your dialog a bit without changing its final appearance. Note the use of the dialog button box instead of two separate buttons on the bottom.
    Attached Files Attached Files

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

    Default Re: Resizing the dialog boxes

    wysota,
    Thanks for correcting the file
    But I have a problem in changing the layout, I am working on the legacy code which was first written in Qt3 and then ported to Qt4
    It would be too much of work for me to change the layout of each of the dialogs and also keeping the look and feel same as previous. There are more complicated dialogs then this.
    I am still not clear about what you wrote about minimum size and the size hint connectivity , can you elaborate more on that.

Similar Threads

  1. disabling resizing of a dialog
    By deepakn in forum Newbie
    Replies: 2
    Last Post: 21st June 2007, 09:14
  2. Resizing the dialog box dynamically
    By vvbkumar in forum Newbie
    Replies: 5
    Last Post: 20th June 2006, 08:54
  3. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22
  4. Problem with resizing dialog
    By Seema Rao in forum Qt Programming
    Replies: 8
    Last Post: 5th May 2006, 17:27
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.