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. QML Freezing Screen

QML Freezing Screen

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 1.0k Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello I am developing an application with QML and C++. I'm having a problem. My QML screen freezes when I send data from C++ thread. I use WorkerScript on the QML side, but it doesn't work.

    main.cpp

    alt text

    Movement Sensor Thread

    alt text

    Main.qml

    alt text

    jsulmJ KroMignonK 2 Replies Last reply
    0
    • ? A Former User

      Hello I am developing an application with QML and C++. I'm having a problem. My QML screen freezes when I send data from C++ thread. I use WorkerScript on the QML side, but it doesn't work.

      main.cpp

      alt text

      Movement Sensor Thread

      alt text

      Main.qml

      alt text

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

      @NullByte Please post your code as text not screen-shot.
      How often do you emit the signal from the thread?

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

      1 Reply Last reply
      1
      • ? A Former User

        Hello I am developing an application with QML and C++. I'm having a problem. My QML screen freezes when I send data from C++ thread. I use WorkerScript on the QML side, but it doesn't work.

        main.cpp

        alt text

        Movement Sensor Thread

        alt text

        Main.qml

        alt text

        KroMignonK Offline
        KroMignonK Offline
        KroMignon
        wrote on last edited by KroMignon
        #3

        @NullByte I suppose MovementSensor is based on QThread? So this cannot work, because you don't have any event queue to handle the signals/slots events.

        Subclassing QThread is not the best way to work with threads on Qt. Please read those articles, they are old but very informative about thread usage with Qt

        • https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/
        • http://blog.debao.me/2013/08/how-to-use-qthread-in-the-right-way-part-1/
        • http://blog.debao.me/2013/08/how-to-use-qthread-in-the-right-way-part-2/

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

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

          @KroMignon the current documentation of QThread has seen a lot of improvements in the explanation on how to use both the worker object approach and subclassing.

          There's also Woboq's very good You were not doing it so wrong article.

          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
          1

          • Login

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