灵活使用QML组件嵌套
TextField {
Layout.fillWidth: true
id: urlField
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhPreferLowercase
text: webView.url
onAccepted: webView.url = utils.fromUserInput(text)
ProgressBar {
anchors.centerIn: parent
style: LoadProgressStyle { }
z: Qt.platform.os === "android" ? -1 : 1
visible: showProgress
minimumValue: 0
maximumValue: 100
value: webView.loadProgress == 100 ? 0 : webView.loadProgress
}
}