Results 1 to 6 of 6

Thread: Resize all components in a dialog

  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Resize all components in a dialog

    I developed one GUI to execute different task, it contains Listbox, LineEdit, Lebel, checkbox, dropdown etc. It may be run in different resolution monitor, I want to make my dialog such a way that, when I resize dialog then internal components will automatically resize. and internal text also shown properly.
    I will work Qt designer with Rhapsody

  2. #2
    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: Resize all components in a dialog

    You should set the size policies to expanding on the widgets you wish to expand.
    Attach the UI if possible.

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resize all components in a dialog

    Now I just attach a testing ui file, I expect my given components will be same ratio size when I will resize the dialog
    Attached Files Attached Files

  4. #4
    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: Resize all components in a dialog

    You'll need to apply a layout. Unselect child widgets, and select "Layout in a Grid" (in toolbar, Form-menu or context-menu).
    J-P Nurmi

  5. #5
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resize all components in a dialog

    If I make Grid layout then all of the child , then all of the component become same size, in my previous post I attach a ui file, in that file you can see, first row's ListBoxs are different shape, my intensition is that if I resize then child components also resize in same ratio. like 20%, 40%, 30% of the dialog width.

  6. #6
    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: Resize all components in a dialog

    Adjust each widgets' sizePolicy-property. Notice horizontal and vertical stretch factors.
    J-P Nurmi

  7. The following user says thank you to jpn for this useful post:

    bdQtdev (10th January 2008)

Similar Threads

  1. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  2. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  3. Replies: 1
    Last Post: 1st February 2007, 17:07
  4. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32
  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.