Dear all
I have a QCombobox that brings its data from QSqlQueryModel,
What I need to do is, everytime i requested for a pop up I need the combo clears its data and repeate QSqlQueryModel
Dear all
I have a QCombobox that brings its data from QSqlQueryModel,
What I need to do is, everytime i requested for a pop up I need the combo clears its data and repeate QSqlQueryModel
Reimplement QComboBox::showPopup() and execute the model's query again there.
searching by forum still works QComboBox & database
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Dear all
We could all ready use QSqlModel for the combo, and we dont have problem with it.
But the problem is, we have a main window that has combos, which is updates from other widgets.
What we would like to do is, everytime we request for a pop up, we need to delete the datas in the combo, and re SELECT from the database again, and fill the combo.
We were not able to find a signal for that.
Please help...
you can use the same model in comboboxes and in another views. so, if you change this model then all views will be updated automatically and comboboxes also. I don't see any problem
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
No the thing is,
The model in the main page is change by the other widget, so we need to change it.
I don't understand the problem in this case.
why you can't set that model to needed combobox?
Qt Code:
... m_comboBox->setModel(m_mySqlModel); ...To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Dear Spirit
We could set the model, but i could not find a signal for combo
like connect(combo... clicked signal setxmodel)
we need a connect like
showpopup
and then set model again...
so, you just need show popup, right?
try to handle this signal QAbstractItemModel::dataChanged
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks