退出在 Qt 下开发的应用程序时,出现以下错误:
file:///C:/Qt/5.10.0/mingw53_32/qml/QtQuick/Controls/Private/Control.qml:90:
ReferenceError: parent is not defined
从组件定义如下:
import QtQuick 2.8
import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Extras 1.4
Item {
id:root
CircularGauge {
anchors.centerIn: root
}
}
如果线
anchors.centerIn: root
被删除,则没有错误。我很确定每当 CircularGauge 以某种方式引用父级时都会产生错误,尽管设置
parent:root
在仪表上没有帮助。知道是什么原因造成的吗?