[Qt-interest] Slots and Signals with a dynamic library
yunqiu liu
yunqiuliu at yahoo.com
Wed Aug 24 19:10:07 CEST 2011
On my understanding, you could try to assign a callback function in the noQt source function in your controller. then try to build a connection between the callback function with the qt source function which can do what you want to do on the GUI side.
Thanks,
Yunqiu Liu
________________________________
From: Aston Karl <karlastong at gmail.com>
To: Bo Thorsen <bo at fioniasoftware.dk>
Cc: "qt-interest at qt.nokia.com" <qt-interest at qt.nokia.com>
Sent: Tuesday, August 23, 2011 10:54 PM
Subject: Re: [Qt-interest] Slots and Signals with a dynamic library
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
>
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110824/0b599615/attachment.html
More information about the Qt-interest-old
mailing list