Skip to content

Instantly share code, notes, and snippets.

@marcelino-m
Last active November 17, 2016 14:13
Show Gist options
  • Save marcelino-m/7332ec5191e34178adfabaa67e9a7841 to your computer and use it in GitHub Desktop.
Save marcelino-m/7332ec5191e34178adfabaa67e9a7841 to your computer and use it in GitHub Desktop.
Last query interpolated QSqlQuery
QString getLastExecutedQuery(QSqlQuery const& query)
{
QString str = query.lastQuery();
QMapIterator<QString, QVariant> it(query.boundValues());
while (it.hasNext())
{
it.next();
str.replace(it.key(),it.value().toString());
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment