views:

95

answers:

1

I wonder if it is possible to specify a constructor in a Qt plugin interface? (extending an app)

I want to force the plugins using the interface to take a parameter in the constructor.

+2  A: 

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.

chalup