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. Thread and signals
Forum Updated to NodeBB v4.3 + New Features

Thread and signals

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 577 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.
  • M Offline
    M Offline
    mahd96
    wrote on last edited by
    #1

    i have a singleton class that handles downloading files. and some other classes that have data of files to be downloaded and pathes and ... . this second classes have some SIGNAL-SLOT connections to Communicate with downloader class. for preformance reseaons i want this conecction to be Queued connections ( this to classes live in same thread). but my slots dont invoke when appropriate signal emits.

    i tried to move my downloader class to another thread so automaticaly i would have a Queued connection but it down'nt work.

    • i contemplate connecting signals after changing thread.
    jsulmJ 1 Reply Last reply
    0
    • M mahd96

      i have a singleton class that handles downloading files. and some other classes that have data of files to be downloaded and pathes and ... . this second classes have some SIGNAL-SLOT connections to Communicate with downloader class. for preformance reseaons i want this conecction to be Queued connections ( this to classes live in same thread). but my slots dont invoke when appropriate signal emits.

      i tried to move my downloader class to another thread so automaticaly i would have a Queued connection but it down'nt work.

      • i contemplate connecting signals after changing thread.
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mahd96 Without code it is hard to say why the slots are not called.
      Are you sure signals are emitted? Do you see any warnings at runtime?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • M Offline
        M Offline
        mahd96
        wrote on last edited by
        #3

        signals are emiting but i got this :
        QObject::connect: Cannot queue arguments of type XXXX

        J.HilkJ jsulmJ 2 Replies Last reply
        0
        • M mahd96

          signals are emiting but i got this :
          QObject::connect: Cannot queue arguments of type XXXX

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @mahd96
          what are the arguments of your signal? My guess is some custom object/class/struct

          That will work fine, if it's used in direct connection, otherwise you'll have to register it to the MetaObjectSystem for Qt to know how to Queue (copy) them.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          2
          • M mahd96

            signals are emiting but i got this :
            QObject::connect: Cannot queue arguments of type XXXX

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @mahd96 said in Thread and signals:

            QObject::connect: Cannot queue arguments of type XXXX

            Take a look at this: http://doc.qt.io/qt-5/qtcore-threads-queuedcustomtype-example.html
            You need to register your own custom types before using them as parameter for signals/slots.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            3

            • Login

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