QueuedConnection problem



  • I'm developing a QT project for Windows. In that project I've a multimedia timer executing some operations an sending some signals.

    In MainWindow class I connect slots to signals.

    My requirement is to let the emit function to be non-blocking so QueuedConnection should be my solution.

    If the connect is done as QueuedConnection, the slot is not called.
    If the connect is done as AutoConnection, the slot is called and the app works fine.

    Can multimedia timers create problems to the QT signal/slot mechanism when connection is Queued?

    Otherwise, what could be the problem ?

    Thanks a lot !



  • If you use a queued connection, the thread to which the "receiving" object belongs needs to be running an event loop (that's because the event loop will fetch the signal from the queue and call the slot function). Are you 100% sure this is the case in your app? Normally your "main" (GUI) thread will be running an event loop (usually via QApplication::exec() called from your "main" function). Then sending signals over a queued connection from "background" threads to the objects that live in the "main" thread should work fine...

    (BTW: Maybe it would be helpful if you give some implementation details about your "multimedia timer")


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.