Results 1 to 4 of 4

Thread: QComboBox not showing all items

  1. #1
    Join Date
    Nov 2007
    Posts
    11

    Default QComboBox not showing all items

    hello,

    i have a list of items (approx 800 long) i am filling a combo box with. however the list seems to truncate in the actual displayed GUI by a large amount.

    it shows items A-P however will show no items past P. is there a way to increase the size of listed items so i can get all A-Z?

    i have tried setting the property maxVisibleItems and maxCount with no success.

    any help would be very appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QComboBox not showing all items

    Hi,

    can you provide a sample code? How do you pass the items to the combobox? if using a model -> fetchMore()? Is your list strait before inserting correct?

    Lykurg

  3. #3
    Join Date
    Nov 2007
    Posts
    11

    Default Re: QComboBox not showing all items

    Qt Code:
    1. void MyObj::FillComboBox(const std::vector<std::string> &items)
    2. {
    3. for(size_t i = 0 ; i < items.size() ; i++)
    4. {
    5. cmbItems->addItem(QString::fromUtf8(items[i].c_str()));
    6. }
    7.  
    8. fprintf(stdout, "items count %d\n", items.size());
    9. fprintf(stdout, "cmb item count %d\n", cmbItems->count());
    10. }
    To copy to clipboard, switch view to plain text mode 
    ------------------------------------------
    item count 829
    cmb item count 829

    again the actual UI displays A-P and then stops.
    Last edited by jpn; 11th April 2008 at 08:11. Reason: missing [code] tags

  4. #4
    Join Date
    Nov 2007
    Posts
    11

    Default Re: QComboBox not showing all items

    i appologize. an xml parse error was effecting my algorithm for adding items into the combo box.

Similar Threads

  1. Occurance of Duplicate items in QComboBox
    By merry in forum Qt Programming
    Replies: 8
    Last Post: 12th September 2007, 15:05
  2. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 12:20
  3. Automatically add items to a QComboBox (Qt4)
    By darkadept in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2006, 15:32
  4. QcomboBox items
    By therealjag in forum Newbie
    Replies: 5
    Last Post: 27th March 2006, 08:21
  5. [QT3] QComboBox: Disable adding items on Enter-keypress
    By BrainB0ne in forum Qt Programming
    Replies: 7
    Last Post: 14th January 2006, 19:43

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.