Results 1 to 3 of 3

Thread: Searching an item in QCombobox

  1. #1
    Join Date
    Dec 2010
    Posts
    2
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1

    Default Searching an item in QCombobox

    Hi everybody,

    I have a little knowledge in Qt but It is the first time I have this problem.

    I have used a QComboBox, and I have insert many items on it (300 items).

    My problem is : how to show an item which begin by a letter "A" for example.

    Regards,

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

    Default Re: Searching an item in QCombobox

    Quote Originally Posted by ramarolahyangelo View Post
    I have a little knowledge in Qt but It is the first time I have this problem.
    Then please use the newbe section.

    Use QComboBox::findText() or QComboBox::findData() and combine the result with QComboBox::setCurrentIndex().

  3. The following user says thank you to Lykurg for this useful post:

    ramarolahyangelo (21st December 2010)

  4. #3
    Join Date
    Dec 2010
    Posts
    2
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1

    Default Re: Searching an item in QCombobox

    thanks!

    I try this option, I will give the result as soon as possible!

    Regards,


    Added after 20 minutes:


    I have finished to try your purpose.

    I have just turned "setEditable()" to true
    and automatically, the QComboBox show the item if it exists when I press a letter!

    Thanks a lot!


    Added after 1 5 minutes:


    My last question about this subject is :
    Is It possible to search an item in an editable QComboBox, but not to modify the content if the keyword doesn't exist?

    Best Regards,
    Last edited by ramarolahyangelo; 21st December 2010 at 09:51.

Similar Threads

  1. Is it possible to drag an item of a QComboBox?
    By jjcarles in forum Qt Programming
    Replies: 3
    Last Post: 9th April 2010, 00:07
  2. Replies: 2
    Last Post: 30th March 2010, 23:51
  3. QcomboBox item height
    By Beppe in forum Qt Programming
    Replies: 9
    Last Post: 16th June 2009, 12:31
  4. Cannot select an item in QComboBox
    By Declan in forum Qt Programming
    Replies: 2
    Last Post: 19th April 2007, 09:08
  5. QComboBox and item
    By drow in forum Qt Programming
    Replies: 4
    Last Post: 14th June 2006, 10:04

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.