Results 1 to 5 of 5

Thread: [QComboBox] (pre-)select no item. (solved)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    55
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    7
    Thanked 1 Time in 1 Post

    Question [QComboBox] (pre-)select no item. (solved)

    Hi,
    Has anyone a link to what is the policy in QComboBox for setting
    the preselection (the current selected item at showing time) ?
    As I have two comboboxes that I fill in the same way
    Qt Code:
    1. cbb->addItem("String", myInt)
    To copy to clipboard, switch view to plain text mode 
    , and I don't use setCurrentIndex.
    I get the first combo pre-selecting the first item and
    the second combo pre-selecting none.
    What triggers the pre-selection ?
    Thanks in advance.

    Edit: it appears that, in fact, the second combo has its first line selected,
    but as it is an empty line I thought it was not (selected).
    So my question becomes (as I tried setCurrentIdx(-1)) :
    how do I make a not editable combobox select no item ?
    Last edited by lauranger; 17th July 2006 at 13:42.

Similar Threads

  1. Replies: 5
    Last Post: 27th May 2006, 13:44
  2. QListWidget/QTreeWidget, etc selected item color
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 15th May 2006, 16:50
  3. QListWidgetItem check/uncheck
    By Arthur in forum Qt Programming
    Replies: 6
    Last Post: 12th May 2006, 10:19
  4. Programattically Clicking an Item in QTreeView
    By johnny_sparx in forum Qt Programming
    Replies: 4
    Last Post: 11th May 2006, 16:26
  5. Replies: 1
    Last Post: 23rd March 2006, 06:37

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.