This is something I stumbled upon when compiling my Qt4 code on a windows box. I'm using Qt 4.3.1.
Originally I had a dynamically loaded plugin (using QPluginLoader) that had a method with this syntax:
On Linux everything compiled and ran fine but when I moved my code over to the Windows box it compiled fine but gave me a: The file "c:/my/project/plugin.dll" is not a valid Qt plugin. error message.
It took me a while to connect this message to the actual problem so I hope this helps someone else out if they are banging their heads against a wall.
I realize that I shouldn't return a QSqlDatabase object but instead use the QSqlDatabase::addDatabase(...) and QSqlDatabase::database() static methods with a named database.
One question I have is, is this the only Qt4 class that I shouldn't use as a return object or are there others?
Bookmarks