Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47678

QWebChannel cannot invoke SLOTS on obejcts in different QThread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.2, 5.7.1
    • 5.4.1
    • WebChannel
    • None
    • QWebChannel project's test folder, using Qt 5.5 layman overlay, installed on Gentoo Linux.
    • e354bdc5cbe33621def2b200f01d6376291570fc

    Description

      Creating a class and moving it to a thread in a different QThread prevents QWebChannel's queued interaction.

      To Reproduce:

      • Implement a new class which contains at least 1 public slot (void return)
      • Create an instance of custom class derived from QObject > myClass
      • Create an instance of QThread > myClassThread
      • move myClass to the newly created thread > myClass.moveToThread(myClassThread)
      • Create an instance of QWebChannel object > myWebChannel (do required websocket connections)
      • Register your object to webchannel > myWebChannel.registerObject(QStringLiteral("myClass"), myClass)
      • Run applicaiton and call public slot of myClass from web application.

      Then it throws an error as below and does not run method.
      QMetaObject::unable to invoke methods with return values in queued connections

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            milianw Milian Wolff
            canavaroski90 ben sen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes