나는 그냥을 배우기 시작했스와는 방법에 대한 질문이 있을 얻을 수 있습니다.currentText 에서 또 다른 구성 요소입니다.
코드 예제:
App {
id: app
width: px(250); height: px(250)
NavigationStack {
Page {
id: page
navigationBarHidden: true
AppText { text: "startpage" }
SimpleButton{
x: 220; y: 0; onClicked: page.navigationStack.push(settingsPage)
}
AppText {
x: 0; y: 50; text: "text " + comboBox1.currentText
}
}
}
Component {
id: settingsPage
Page {
navigationBarHidden: true
AppText { text: qsTr("settings page") }
SimpleButton{
x: 220; y: 0; onClicked: page.navigationStack.push(lastPage)
}
ComboBox {
id: comboBox1
currentIndex: 0
x: 10; y: 40
style: ComboBoxStyle {
label: Text {
text: control.currentText
}
}
model: ListModel {
ListElement { text: "green" }
ListElement { text: "dark-green" }
ListElement { text: "blue" }
}
}
AppText {
x: 0; y: 90; text: "text " + comboBox1.currentText
}
}
}
Component {
id: lastPage
Page {
navigationBarHidden: true
AppText { text: qsTr("last page") }
SimpleButton{
x: 220; y: 0; onClicked: page.navigationStack.push(page)
}
AppText {
x: px(50); y: px(90); text: "text " + comboBox1.currentText
}
}
}
}
->가 선택한 Listelement ko 에서 설정 페이지에서 사용하는 구성 요소 id:lastPage
어떤 도움이 될 것이 크게 감사
Window
에 상관 없기에,나는 그냥 보여주고 싶었어요 개념,작동 예시