Results 1 to 2 of 2

Thread: QCombobox - interaction between edit text and list items

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QCombobox - interaction between edit text and list items

    Hi,

    I'm trying to understand the interation between the text in the edit control and the list items in a QCombobox - version 4.4.3.

    Take an empty combo and call setEditText( "peach") the state is
    count() = 0
    currentIndex() = -1
    currentText() = peach

    Now add items "apple", "orange" & "pear"
    count() = 3
    currentIndex() = 0
    currentText() = apple
    The current text has been wiped and replaced by the 1st item in the list.

    Now set the edit text again setEditText( "peach")
    count() = 3
    currentIndex() = 0
    currentText() = peach
    The current index and text are now mismatched because "peach" is not in the list.

    When the edit text is not empty, I would have expected the addItems() only to change the count. Does the api require a call to setCurrentIndex(-1) for every setEditText() call?

    Thanks for any help.

    John.

  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: QCombobox - interaction between edit text and list items

    I would submit that as a bug to the task-tracker.
    J-P Nurmi

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.