Results 1 to 3 of 3

Thread: Popup of QComboBox wider than combobox?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2014
    Posts
    23
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Popup of QComboBox wider than combobox?

    You can set the minWidth property of the combobox's view. One way to do this is with a stylesheet. Another way is to calculate the largest text width of all items (utilizing font metrics) and then set the width of the view accordingly. The latter needs to be done as soon as an item is added/removed.

  2. The following user says thank you to Killian for this useful post:

    Ginsengelf (21st October 2016)

  3. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    518
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Popup of QComboBox wider than combobox?

    Thanks, this works.

    Ginsengelf

Similar Threads

  1. Replies: 3
    Last Post: 2nd November 2015, 16:33
  2. Replies: 0
    Last Post: 18th August 2013, 18:07
  3. QComboBox popup
    By berchio in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2012, 20:05
  4. QComboBox Popup position
    By alitoh in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2011, 10:16
  5. QComboBox popup
    By aekilic in forum Qt Programming
    Replies: 9
    Last Post: 6th January 2009, 10:24

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.