Look at QSqlQuery docs in the Details section for information related to binding variables into prepared queries.