You can start SQL search, say, 1 second after
last editTextChanged() was emitted. Thus You should do something like
|
Source code
|
1
2
3
4
|
timer->setSingleShot( true );
timer->setInterval( 1000 );
connect( comboBox, SIGNAL(editTextChanged(QString)), timer, SLOT(start()) );
connect( timer, SIGNAL(timeout()), this, SLOT(performHugeSQLQuery()) );
|
Your searching will be a little delayed, but requiring user to type the expression that will be sought in database and [/B]then
clicking somewhere else (which is not needed when You select one of the predefined values in QComboBox) is not very user-friendly. I am afraid that there is no better way to look in Your user mind and find out whether he has finished typing or not :-)