Is there a way to stop Qt rendering temporarily?

∥☆過路亽.° 提交于 2021-01-28 05:52:57

问题


I'm developing a qml UI using Qt Quick 2D Renderer on an ARM embedded device which runs linux. The device has a LCD screen and some standby mode when it is inactive.

For some reasons (network needs to stay active), suspend to RAM is not an option. However, to lower the power consumption in standby mode it would be good to stop the UI rendering. Can this be achieved with some Qt API?


回答1:


Connect directly (Qt::DirectConnection) to the QQuickWindow::beforeRendering() signal. That will be in the render thread, the program can wait there on your mutex/condition_variable. GUI thread is unlocked during this step so the application logic will continue working.

http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html

Can probably also override the whole sequence by using QQuickRenderControl.



来源:https://stackoverflow.com/questions/48766582/is-there-a-way-to-stop-qt-rendering-temporarily

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!