Results 1 to 3 of 3

Thread: QComboBox that stays expanded

  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QComboBox that stays expanded

    Hi,

    I am a beginner with Qt-programming and I have the following problem:

    I am trying to implement a editable custom QComboBox to display search results. The user should be able to type a string to the combo boxes line edit and the search results would be shown in the expanded QListBox. I am now able to get the results on the QListBox and popup it but the focus also changes to the expanded QListBox which prevents further input.

    The desired function would be that the user would be able to type without changing the focus manyally and the content of the expanded list box would be updated accordingly much like in the address input in the firefox where known addresses are shown.
    Any ideas how to implement this?

    Thank you for your help,
    BR,
    Jarkko

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox that stays expanded

    I guess you need QCompleter.
    You can set it with QComboBox::setCompleter
    Have a look at exampled in Qt demos

  3. #3
    Join Date
    Sep 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox that stays expanded

    Quote Originally Posted by aamer4yu View Post
    I guess you need QCompleter.
    You can set it with QComboBox::setCompleter
    Have a look at exampled in Qt demos
    Hi,

    Thanks for the reply. That is exactly what I need. Unfortunately I have to upgrade an existing application that was implemented with Qt3 (and has not been ported to Qt4) so I cannot use the QCompleter. I forgot to mention the version information (3.3.8) in the original post. My apologies.

    Jarkko

Similar Threads

  1. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25

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.