How to specify Qt plugin constructor?

I wonder if it is possible to specify a constructor in the Qt plugin interface? (application extension)

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

+6
c ++ constructor plugins interface qt
source share
1 answer

I donโ€™t think itโ€™s possible to do exactly what you described.

However, you can try to create a factory object and then pass the parameters to the YourFactory :: create () method, which returns a pointer to the YourObject object. Another way (ugly IMHO) is to add the Initialize () method to YourObject. Check out the QFontEnginePlugin and QScriptExtensionPlugin interfaces for both approaches.

+4
source share

All Articles