Hi,

I'd like to use the setFilter() function of a QSqlTableModel.

I could do it using
Qt Code:
  1. model.setFilter("name LIKE %"+name+"%");
To copy to clipboard, switch view to plain text mode 
But to prevent SQL injection attacks, I'd like to do it like that:
Qt Code:
  1. model.setFilter("name LIKE :name);
To copy to clipboard, switch view to plain text mode 
The problem is, that I don't know how to bind the :name value because the filter is just populated to the model.query() after calling model.select().

How can I bind the value of :name?


Thanks!

Manuel