[Solved] Popup of QComboBox showing and immediately hiding
-
Hello!
I derived QComboBox and reimplement showPopup() function where I'm dynamically filling model before call parent QComboBox::showPopup() like this:
@void MyComboBox::showPopup()
{
fillModel();
QComboBox::showPopup();
}@But, if fillModel() calling for a long time (above 1-2 seconds), popup is showing and immediately hiding. What is reason of it and how can I change this behaviour?
-
Hi,
How are you filling the model ? And why do it at that time ?
-
There is table and MyComboBox is a filter for every column in table header which contains unique values of columns. These values retrieving from database and filling all filters immediately is not optimal if table has many columns and rows. Function fillModel() is trivial:
@
void MyComboBox::fillModel()
{
clear();
QStringList values = fooBar();
addItems(values);
}
@ -
So fooBar() accesses the database before to populate combo box model ?