PDA

View Full Version : QComboBox that stays expanded



jma
21st January 2009, 06:55
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

aamer4yu
21st January 2009, 07:15
I guess you need QCompleter.
You can set it with QComboBox::setCompleter

Have a look at exampled in Qt demos

jma
21st January 2009, 07:50
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