JeanC
9th January 2008, 19:51
Hi it's me again :)
How can I filter a QSqlTableModel so that only rows show up that have a certain cell contain a substring, like the sql LIKE clause?
The setFilter() member filters only on the whole string.
I tried a query like:
QString str = QString("SELECT * FROM pix WHERE 'name' LIKE '%%1%'").arg(nameEdit->text());
QSqlQuery query(str);
model->select();
But this seems not the way to go.
Thanks.
How can I filter a QSqlTableModel so that only rows show up that have a certain cell contain a substring, like the sql LIKE clause?
The setFilter() member filters only on the whole string.
I tried a query like:
QString str = QString("SELECT * FROM pix WHERE 'name' LIKE '%%1%'").arg(nameEdit->text());
QSqlQuery query(str);
model->select();
But this seems not the way to go.
Thanks.