我有这个信号
class SystemUICfgScanner
{
/*code here*/
signals:
void error(QString desc);
/*more code*/
};
在QML中,我是这样使用InfoBanner的:
InfoBanner
{
property string infodetails: ""
id: systemuicfgErrorBanner
text: "Error: " + infodetails
Connections
{
target: cfgScanner
onError: infodetails = desc
}
}
当发出 error(QString) 信号时,我收到了这个错误。
Invalid write to global property "infodetails"
我做错了什么?
提前致谢。
onError: systemuicfgErrorBanner.infodetails = desc
。需要注意的是,翻译要保证内容准确无误,通顺易懂,并且不得添加解释或其他额外内容。 - aleks_misyuk