Hmm... I suggest looking at the docs. QSqlDatabase is a value-based class. You should create it on the stack and not on the heap. And you don't need to store pointers to it as you can always retrieve the object by name nor you should use the constructor directly.
Yes. I read that. But why should I do a named lookup for every query when I can store the pointer instead? I stored it as a class member in my database abstraction class. Works perfectly. Where is there going to be a problem?
Bookmarks