Results 1 to 3 of 3

Thread: Cannot select an item in QComboBox

  1. #1
    Join Date
    Apr 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Cannot select an item in QComboBox

    Hello,

    I've got a weird error in that I have a QComboBox which has been populated by a LocationTableModel class (which inherits from QAbstractTableModel). It gets populated with a couple of items upon my application loading but when I go to select an item the item list that drops down just stays visible not letting me click on an item

    If I move away from the QComboBox and click somewhere else onscreen then the list disappears (as expected). But, as stated already, I cannot select a list item. Generally for other QComboBoxes and models I haven't had problems. Any ideas? I'm not sure what kind of info to provide to explain the prob better so I've just included the LocationTableModel.cpp file. My best guess was that I was doing something stupido in the data() method.

    Regards,
    Declan
    Attached Files Attached Files

  2. #2
    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: Cannot select an item in QComboBox

    Make LocationTableModel::flags() return Qt::ItemIsEnabled (together with the selectable flag) also for valid indices.
    J-P Nurmi

  3. #3
    Join Date
    Apr 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cannot select an item in QComboBox

    Thanks a million, jpn. That's done the job nicely!

    Kind regards,
    Declan

Similar Threads

  1. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 16:14
  2. QComboBox and item
    By drow in forum Qt Programming
    Replies: 4
    Last Post: 14th June 2006, 09:04
  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. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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.