Results 1 to 2 of 2

Thread: Slots/Signals with dynamic library

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Slots/Signals with dynamic library

    Hello,

    I have a Qt application which dynamically launch a library (with dlopen I think), which is called a controller. The controller don't use Qt at all.

    I'd like to add a class which uses slots and signals and use this class in my controller. Unfortunately, I can't use slots and signals and I don't understand why. It seems that the signals are never emitted.

    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. I guess that QApplication is already instantiate in the main program.

    Is there any special instruction to do to use the power of slots and signals while using shared library ?

    Thank you by advance.

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Slots/Signals with dynamic library

    You can call any function through the signals/slots mechanism, but the connect, emit and receiver all have to be within the Qt framework. If you want to connect to an external library, you can put a thin wrapper class around its calls that act as slots or emit signals. Signals and slots, though, are a Qt construct and cannot be used directly by a non-Qt object.

Similar Threads

  1. Dynamic library on Mac, Library not loaded
    By grayfox in forum Newbie
    Replies: 2
    Last Post: 2nd July 2011, 03:42
  2. Dynamic library with GUI for Mac
    By mouse_sonya in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2010, 13:23
  3. QTForm in QT Dynamic Library
    By Kokos in forum Newbie
    Replies: 1
    Last Post: 17th February 2010, 16:56
  4. Linking Qt in a dynamic library
    By dave_mm0 in forum Qt Programming
    Replies: 4
    Last Post: 18th July 2009, 17:28
  5. Dynamic widgets adding and connecting signals& slots
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2009, 13:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.