how to specify Qt plugin constructor?
I wonder if it is possible to specify a constructor in a Qt plugin interface? (extending an app)
I want to force the plugi开发者_如何学Cns using the interface to take a parameter in the constructor.
I don't think that it's possible to do exactly what you described.
However, you might try to create factory object and then pass parameters to YourFactory::create() method, which returns pointer to YourObject. Another (uglier IMHO) way is to add initialize() method to YourObject. Check interfaces of QFontEnginePlugin and QScriptExtensionPlugin for both approaches.
精彩评论