Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt QML app in new thread
Forum Updated to NodeBB v4.3 + New Features

Qt QML app in new thread

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 434 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Damian7546
    wrote on last edited by
    #1

    Hi,

    I write a simple application in Qt logic and QML application. SystemConstroller is a class registered in QML. Among other things, I use SLOT and SIGNAL mechanism like below:

    SystemController::SystemController(QObject *parent)
        : QObject{parent}
    {
        C56SdkApp *c56SdkApp = new C56SdkApp();
        QObject::connect(this, SIGNAL(text2PrintChanged(QString)), c56SdkApp, SLOT(printText(QString)));
    }
    

    But when I try pass my object to new thread look like the mechanism SIGNAL and SLOT Stops working ,because I do not "communication" between my classes I should do something more to pass obiect to new thread?

    SystemController::SystemController(QObject *parent)
        : QObject{parent}
    {
        QThread *threadPrinter = new QThread();
        C56SdkApp *c56SdkApp = new C56SdkApp();
       c56SdkApp->moveToThread(threadPrinter);
        QObject::connect(this, SIGNAL(text2PrintChanged(QString)), c56SdkApp, SLOT(printText(QString)));
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      Didn't you forget to start the thread ?

      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
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        What exactly is C56SdkApp ?

        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
        • D Offline
          D Offline
          Damian7546
          wrote on last edited by
          #3

          @SGaist said in Qt QML app in new thread:

          What exactly is C56SdkApp ?

          It is a class to communicate with printer.

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

            Didn't you forget to start the thread ?

            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
            3
            • D Offline
              D Offline
              Damian7546
              wrote on last edited by
              #5

              I really forgot, my mistake. Thanks!

              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