开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜