Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Signal-slot connection, made in plugin, loaded from another thread doesnt works
QtWS25 Last Chance

Signal-slot connection, made in plugin, loaded from another thread doesnt works

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vladstelmahovsky
    wrote on last edited by
    #1

    Hi

    found an issue, may be it known one

    I'm loading an plugins and create connections within the plugins instances. If the plugins loaded from main thread, all connections works, however, if I'm loading plugins from another thread, connections doesnt works

    how to fix this?
    I want my plugins to be loaded from another threads, because there is lot of them and app startup will takes forever if I'll do this in main thread

    Thanks

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      do you use the queued connection type?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vladstelmahovsky
        wrote on last edited by
        #3

        yes, I've added Qt::QueuedConnection but this didnot helped

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          what kind of thread are you using to load the plugins and how do you load them ?

          Do you mean the connections within the plugin doesn't work or between your application and the plugins ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vladstelmahovsky
            wrote on last edited by
            #5

            Hi
            thread is a class, subclassed from QThread
            Loading plugins in method run() using QPluginLoader

            the connection within loaded plugin doesnt works

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Can you create a minimal compilable sample application that reproduce the problem ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vladstelmahovsky
                wrote on last edited by
                #7

                well, the minimal sample will be half of my project

                1 Reply Last reply
                0
                • raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by
                  #8

                  so either way your project isn't very big yet, or the example isn't "minimal".
                  This should be minimal in terms of 30-40 lines of code IMHO.

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    KA51O
                    wrote on last edited by
                    #9

                    one approach to debug this could be to add a qDebug or console output for every connect statement in your plugins printing out the return value of the connect statement (true/false) and some sort of identification of the affected connect statement. this way you can at least find out which connect statements fail.

                    Maybe the objects being unsuccessfully connected can give a hint to the cause of the problem.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved