有没有办法暂时停止Qt渲染

有没有办法暂时停止Qt渲染

本文介绍了有没有办法暂时停止Qt渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Linux 的 ARM 嵌入式设备上使用 Qt Quick 2D Renderer 开发 qml UI.该设备有一个 LCD 屏幕,当它处于非活动状态时有一些待机模式.

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.

出于某些原因(网络需要保持活动状态),不能选择暂停到 RAM.但是,为了降低待机模式下的功耗,最好停止 UI 渲染.这可以通过一些 Qt API 实现吗?

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?

推荐答案

直接连接 (Qt::DirectConnection) 到 QQuickWindow::beforeRendering() 信号.那将在渲染线程中,程序可以在您的互斥锁/条件变量上等待.GUI 线程在此步骤中被解锁,因此应用程序逻辑将继续工作.

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

也可以使用 QQuickRenderControl 覆盖整个序列.

Can probably also override the whole sequence by using QQuickRenderControl.

这篇关于有没有办法暂时停止Qt渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 14:42