如何重绘Qt window或tabview

想点一个按钮,出来对话框。对话框上有个百分比数字是随另一个JavaScript文件里的变量变化而变化的。
这样的话对话框应该要重绘吧?但查了许多资料都没找到方法。

这个对话框是在Qml里有一个Windows下有tabview,百分比数字是label标签,文字是由JS里的变量+固定文字。

想在Window里加个Timer来重绘,如何实现?

代码如下:
MyDlg.qml:

import "MyJs.js" as MyJs

Window {

            id: myDialog
            width: 300
            height: 300

                        Timer {
    interval: 1000; running: true; repeat: true
    onTriggered:
    {

            }
                            TabView {
                                    id:myTabView
                                    width: parent.width
                                    height: parent.height

                                    Tab {
                                            title: "tab 1"
                                            id: myTab1
                                            text: MyJs.displayText
                                            }
                            }

}

MyJs.js:

var displayText = "0";

你周期性更新label上的文字就可以了
ui->label->setText

我也在查这个问题的解,我知道qt线程通信可以实现此功能,再开个线程查询js中的量,用信号和槽进行线程通信