Hi guys,
I'm stuck with a problem, I was so proud that the search function worked in my table view 
This is the code
orderModel->setQuery("SELECT c.*, o.* FROM clients AS c, orders AS o WHERE o.cid = c.cid and o.currentStatus = 1 AND articleDescription LIKE '%blaat%'");
orderModel->setQuery("SELECT c.*, o.* FROM clients AS c, orders AS o WHERE o.cid = c.cid and o.currentStatus = 1 AND articleDescription LIKE '%blaat%'");
To copy to clipboard, switch view to plain text mode
But it has to be dynamical sow I came up with this piece of code
query.prepare("SELECT c.*, o.* FROM clients AS c, orders AS o WHERE o.cid = c.cid and o.currentStatus = 1 AND :column LIKE '%:searchString%'");
//orderModel
orderModel->setQuery(query);
QSqlQuery query;
query.prepare("SELECT c.*, o.* FROM clients AS c, orders AS o WHERE o.cid = c.cid and o.currentStatus = 1 AND :column LIKE '%:searchString%'");
query.bindValue(QString(":column"), QVariant(column));
query.bindValue(QString(":searchString"), QVariant(searchString));
//orderModel
orderModel->setQuery(query);
To copy to clipboard, switch view to plain text mode
Before I wrote this code I did use a QString and the append function to generate the code. And that didn't work even.
I tested the query and it works well.
Does somebody know how to solve this problem?
Bookmarks