Houss_gc
Houss_gc

Reputation: 749

Extensible application using Qt

I am working on an application which interact with a database and construct reports, I want this application to be extensible and I can in the future to integrate custom report builders to the application as plugins.

I have some question about the plugin architecture supported by Qt:

Another question: is there any framework to develop service based qt application ?

Upvotes: 0

Views: 133

Answers (1)

Felix
Felix

Reputation: 7146

Can I load the plugins in there own processes ?

Not with the plugin mechanism (QPluginLoader). The plugin mechanism dynamically loads libraries (different threads are possible). However, your plugins can be a normal application, that gets started by your main application via QProcess, and exchange data via stdin/stdout (or other IPC mechanisms)

How could I send some custom QML type from the plugin to main application and hook some event handlers on it.

In case you use normal plugins, simply add method that returns the created QML object. Have a look at:https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html#loading-qml-objects-from-c

In case you want to use the multi process version, it gets slightly more complicated. Pass the QML code via stdout and create it in your main application. Pass some "communicator" object to this created QML object, so that the QML type can send back data via that communicator to it's original process.

Upvotes: 1

Related Questions