Results 1 to 3 of 3

Thread: size comboboxes

  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default size comboboxes

    hello, i have 3 combobox and 3 horizontal spacer put in this way on my window

    spacer1 - combobox1 --> vertical layout
    spacer2 - combobox2 --> vertical layout
    spacer3 - combobox3 --> vertical layout

    all them are into grid layout.
    I'd like that the width for all the combobox is equals at the widthest combobox size.
    for example, if the combobox1 value is "123456789", the combobox2 value is "12345" and the combobox3 value is "12" the comboboxes size should be the combobox1 size value. Is it possible?
    Thank

  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: size comboboxes

    Yes, ignore the spacers, put all comboboxes into a single vertical layout and set the horizontal size policy of each combobox to minimum. See the attachment for an example.
    Attached Files Attached Files

  3. The following user says thank you to wysota for this useful post:

    mattia (14th November 2007)

  4. #3
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: size comboboxes

    thanks so much for your help!

Similar Threads

  1. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  2. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  3. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22: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.