qcombobox with multiple columns
Hello,
I'm trying show QTableView in QComboBox.
Example Department is table in my database.
Query =
Quote:
SELECT Dep.Code,Dep.Name FROM Dep
and I've tried this my code.
Code:
depModel->setQuery("SELECT Dep.Code,Dep.Name FROM Dep");
.
.
.
cboxTable->setModel(depModel);
courseComboBox->setView(cboxTable);
but not work.Where is my problem ? I want see multiple columns.
Here is this problem stackoverflow link
Re: qcombobox with multiple columns
What "does not work" about it? You see no data, no drop down, no columns, only one column, the wrong value when selected, pink MS Comic Sans text? Where do you set the model on the combo box?