QML Freezing Screen
-
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
Movement Sensor Thread
Main.qml
-
@NullByte Please post your code as text not screen-shot.
How often do you emit the signal from the thread? -
@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
-
@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.