how to set QComboBox on qsqlquerymodel header
Hi,
I need to show the combobox widget on a qsqlquerymodel header. (in the second column header)
In my code i overrided the headerData() method.
But combobox is not coming.Its showing empty.
My Code,
Code:
UserQueryModel *model = new UserQueryModel (ui.table);//derived from qsqlquerymodel class
model->setQuery("select * from sf_search");
ui.table->setModel(model);
{
public:
{
mTable = table;
layout->addWidget(box);
variant.setValue(&widget);
}
QVariant headerData
( int section, Qt
::Orientation orientation,
int role
) const {
if(section == 2 && (orientation == Qt::Horizontal))
{
return variant;
}
}
Can somebody help me with this??