I remember correctly, you have to call prepare between execute calls. I would be cautious about creating a query on the stack of a function and then returning that query. Probably the query copy constructor is smart enough not to make a copy of all the results, but I would check it out. You can do some rudimentary profiling with qdebug and qtime.
Bookmarks