[Qt-interest] Slots and Signals with a dynamic library
Aston Karl
karlastong at gmail.com
Wed Aug 24 07:54:35 CEST 2011
I don't really get it. I don't really need to access to the interface of the
application. I think that I just need to "be in the same event loop". Wrong
? I actually can't touch anything of the main application. What I can only
do is to create plugins.
2011/8/24 Bo Thorsen <bo at fioniasoftware.dk>
> Den 23-08-2011 20:29, Jean Noel skrev:
>
> Hello,
>>
>> I have a Qt application which dynamically launch a library, which is
>> called a controller. The controller don't use Qt at all. The application
>> and the controller are both compiled with cmake.
>> I'd like to add a class which use slots and signal and use this class in
>> my controller. Unfortunately, I can't use slots and signals and I don't
>> understand why.
>>
>> The connect() method returns true but the signals are never emitted.
>>
>> I tried to instantiate a new QApplication in my class but it doesn't
>> work. The application doesn't launch.
>>
>> Is there any special instruction to do to use the power of slots and
>> signals while using shared library ?
>>
>
> When using plugins (which is your case here) it's a safe practice to access
> only interfaces in the application. In your case, I would probably choose to
> build a proxy class that has an interface exposed to the plugin (with a hook
> interface if necessary) and a QObject subclass implementing the interface on
> the other side.
>
> This way you have a clean separation between the two parts of your
> application.
>
> Bo Thorsen,
> Fionia Software.
>
> --
>
> Expert Qt and C++ developer for hire
> Contact me if you need expert Qt help
> http://www.fioniasoftware.dk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110824/5e48f522/attachment.html
More information about the Qt-interest-old
mailing list