I didn't share your point of view. I agree QSqldatabase is not multithread. But take a better look at my code, please, before blaming it.
I disagree in the fact that this piece of code is not working, because is currently in a production software and I have no problems with it. Sometimes reality comes and shows you're wrong...
If you take a closer look at the code, you can see I DON'T execute multiple threaded calls to the database. I suggested to wrap the call, that locks the main thread whith a "working" while that allows GUI to show updates, mouse / window movements, etc.
I proposed a wrapped call to avoid re-writing entire program, but allowing the GUI stay active wile running slow queries. It works, as I said before. And is simple to replace a call like this :
Qry.exec ( "SELECT * FROM FAR_TABLE" )
QSqlQuery Qry;
Qry.exec ( "SELECT * FROM FAR_TABLE" )
To copy to clipboard, switch view to plain text mode
to one like this
ExecQueryWrapper ( Qry, "SELECT * FROM FAR_TABLE" )
QSqlQuery Qry;
ExecQueryWrapper ( Qry, "SELECT * FROM FAR_TABLE" )
To copy to clipboard, switch view to plain text mode
without great effort...
Bookmarks