Results 1 to 2 of 2

Thread: How to set custom height for ListView & ComboBox items

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Question How to set custom height for ListView & ComboBox items

    I've developed a touch screen application in which user selects an item in qcombobox. Since it's touch screen, the height of each item is needed to be increased for easy selection of item in the combo. Even if I increase the height of qcombobox widget, the height of each item after dropdown remains same.

    I'm looking for another option to create a qlistview & display the list on button press. Even in this case I'm unable to set the height of each item.

    Please help me with this.
    Thank you.

  2. #2
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: How to set custom height for ListView & ComboBox items

    As to QComboBox you could try the following:
    1. Set styled item delegate to your combobox:
    Qt Code:
    1. combo->setItemDelegate( new QStyledItemDelegate );
    To copy to clipboard, switch view to plain text mode 
    2. Set style-sheet like the following:
    Qt Code:
    1. min-height : 32px;
    2. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Associate data with child items in listView
    By moiit in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2011, 12:56
  2. Replies: 0
    Last Post: 18th February 2011, 09:24
  3. Replies: 0
    Last Post: 21st October 2010, 07:14
  4. Qt listView total height
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2008, 19:16
  5. Custom Listview with all-time editable items
    By ivan.cukic in forum Qt Programming
    Replies: 5
    Last Post: 6th September 2006, 16:15

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.