Perhaps You could try using unnamed parameters. In my code I use something like this:
Query q("SELECT * FROM tag WHERE tag = ?", connection);
q << name;
Query q("SELECT * FROM tag WHERE tag = ?", connection);
q << name;
To copy to clipboard, switch view to plain text mode
which uses following piece of code:
Query
&Query
::operator <<
(QVariant ¶m
){
queryObject.bindValue(_paramBound++, param);
return *this;
}
Query &Query::operator <<(QVariant ¶m)
{
queryObject.bindValue(_paramBound++, param);
return *this;
}
To copy to clipboard, switch view to plain text mode
I know this solution is not perfect and has some flaws, but for sure it can be used this way to pass QLists as list of values to bind query parameters.
Bookmarks