Quote Originally Posted by MorrisLiang View Post
Well,the plugin thing is actually kind of difficult for me.According to the QT tutorial I read,plugins have to inherit from an interface,so the QPluginLoader will recognize them.
But if you take a look at QtCreator's source code,you wil find that it doesn't use marcos like Q_EXPORT_PLUGIN2().Besides,all the plugins inherit from a abstract base class called IPlugin(not interface).And the QPluginLoader still loads them.
And I want to know why too...
I had no trouble at all implementing an interface and several plugins, following Trolltech's examples. They work perfectly. The problem here is trying to implement something akin to Java-style "adapter classes," where an intermediate class with implementation of the pure virtual functions declared in the interface is used to ease creation of inherited classes.

I suspect that the Qt framework only allows inheritance directly from the abstract base class. At least, that seems to be the case in practice, as noted.