简体   繁体   English

qml 参考错误:<control id> 没有定义</control>

[英]qml ReferenceError: <Control id>is not defined

The "Control id" is a TextInput control. “控件 ID”是一个 TextInput 控件。 in function change TextInput text.在 function 中更改 TextInput 文本。 the function is in root,the TextInput is put in sub but deep. function 位于 root 中,TextInput 位于 sub 但很深。 if The "Control id" in TabView will find not.如果 TabView 中的“控件 ID”找不到。 if not can find.如果没有可以找到。

This issus is over.本期结束。 I add a Rectangle in root.我在根中添加了一个矩形。 and add a signal.并添加一个信号。 In Tab page, according to the signal, call the funcion to change control info.在Tab页,根据信号,调用函数改变控制信息。 get control info.获取控制信息。

In the main pange Like this:在主面板中像这样:

    Rectangle
    {
        id:uiManager;

        x:0;
        y:200;
        width:0;
        height:0;
        color:"#FFFF0000";
        property  int  add;
        signal setKeyValue;
    }

In Tab page like this:在标签页中是这样的:

Connections
{
    target: uiManager;
    onSetKeyValue:
    {
        console.log("test Page0");
        uiManager.add = 10;
        console.log(uiManager.add);
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM