2
아래 TabbedPane을 정의했지만 각 탭마다 하나의 파일에 코드를 포함하는 대신 "questions.qml"(탐색 창 ") 및"stats.qml "내용을 표시하고 싶습니다. ?다른 qml 파일에 정의 된 TabbedPane에 페이지 또는 탐색 창을 연결하는 방법?
import "UI" // The file DataManagement.qml is located in the directory UI
// which is a sub-directory of the location of this QML file.
...
Tab {
title: qsTr("Data Management")
imageSource: "asset:///images/icons/database.png"
id: dataManagement
DataManagement {
id: dataManagementPage
}
}
...
을 그 다음에 : 나는 그것을 달성 할 수있는 방법 궁금하면 내가 그 경우에 무슨 짓을
TabbedPane {
showTabsOnActionBar: true
Tab {
id: questions
title: "Questions"
description: "This tab will have questions in current hub"
}
Tab {
id: stats
title: "Stats"
}
}
감사합니다. 그 일. 그러나 파일이 다른 디렉토리에 있다면? 이 경우 어떻게해야합니까? – itsaboutcode
그 또한 쉽습니다. 내 사용자 인터페이스 QML 파일을 assets/UI 디렉토리에 넣었습니다. 그래서 main.qml 파일에 "UI"라는 줄 가져 오기를 포함 시켜서 이것을 대답으로 편집했습니다. – Richard
Richard에게 감사드립니다. 정말 도움이됩니다. – itsaboutcode