PDA

View Full Version : Plugins as small application



blackliteon
11th January 2006, 08:22
I have my big application, and wish that my clients get only DLL`s thats thay need.
So, every DLL have very big functionality WITH .ui files and graphic

How can I implement this?
It seems like:
Main window with tab control, I search for plugins, is find them, create new tab in TabControl and implement dialogs, main interface in tab, classes.
In low level API for plugins or with DESIGNER plugins?
Can you help me?

Mike
11th January 2006, 08:45
Hi,

I try to do something similar with my app MKBlog (http://www.michael-krueger.org/mkblog.html). I played with different concepts of how to use plugins with Qt and C++. First I saw that Qt also offers a plugin concept, but thought that it was only to extend Qt-Designer or so... then I realized that this was really generic stuff. Now I use it myself in my little app that I try to build.
What you have to do, is fairly good documented here:
Main-App (http://doc.trolltech.com/4.1/tools-plugandpaint.html) and it's Plugins (http://doc.trolltech.com/4.1/tools-plugandpaintplugins-basictools.html).

What you need to know is that qmake knows a third option to create projects:

1) app
2) lib
3) plugin <---

The third is the target type your plugins must use. It's working great. After using QPluginLoader to load the plugin, it really doesn't matter if it's a UI class implementing a widget, or some business logic.

Hope it helps... good luck

Mike
11th January 2006, 09:07
ups.. not quite correct. Off course the target template for a plugin is still lib!!! But you need to add a config entry:

CONFIG += plugin

to you plugin project...

blackliteon
11th January 2006, 11:41
Thanks!
I just dont know about this future in QT..

mod07_07
12th January 2006, 10:39
Plugins are working great for me. Also have a big application and broke it into plugins. Just remember to export all the methods and functions you will need to use the plugin and also remember to setup an interface with pure virtual functions ....