PDA

View Full Version : Make shared libraries available in QtScript



TorAn
17th November 2009, 14:00
I have collection of shared libraries, each one specialized for individual calculation process.
I have headers defining exported class for each of these libraries , but not the source code of the library itself.

My question is:
Is it possible to make these libraries available for QtScript in run-time without statically compiling there interfaces with my application?

The only approach I could come up is:
1. For each library create a wrapper in Qt that wraps shared library interface with Qt plugin conventions, making this wrapper a Qt plugin.

2. My app can read new Qt header and become "aware" of the plugin interface class

3. Somehow "map" the call to the class to the internal generic class.

May be there is a better, or completely different approach?

wysota
17th November 2009, 17:00
It's possible in general but you need to do pretty much coding unless the classes inherit QObject. Read QtScript docs about mapping to and from C++ objects and ask questions about specific things when you encounter problems.