Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用画布(与 html5 中使用的相同)在 qml 中制作图表。我需要每隔一秒左右重新绘制一次屏幕。有没有可以更新屏幕的功能?我想绘制可以每秒更新值的动画图。
只需使用 Timer 组件:
import QtQuick 2.0 Canvas { id: myCanvas; onPaint: { // do anything you need } Timer { interval: 1000; running: true; repeat: true; onTriggered: { myCanvas.requestPaint ( ); } } }