# HG changeset patch # User sl # Date 1401265232 -7200 # Node ID b3cce7791326a7e1464962d59f7080e1e7d0cd85 # Parent b1b049e28772fd16b2476589d2d3b77a1ca24efc Async loading of our tabs. Displaying progress bar during tab loading. diff -r b1b049e28772 -r b3cce7791326 main.qml --- a/main.qml Wed May 28 08:06:27 2014 +0200 +++ b/main.qml Wed May 28 10:20:32 2014 +0200 @@ -16,6 +16,7 @@ height: 480 title: qsTr("MiniDisplay Manager") SystemPalette { id: palette } + //Component.onCompleted: progressBar.visible=tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready Settings { property alias x: appWindow.x @@ -36,6 +37,12 @@ }*/ + function trackProgress() + { + progressBar.value = tabViewMain.getTab(tabViewMain.currentIndex).progress; + progressBar.visible = tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready; + } + MiniDisplay { id: display onOpened:{ textDisplayStatus.text=qsTr("Connected");} @@ -43,21 +50,40 @@ onOpenError:{ textDisplayStatus.text=qsTr("Connection error");} } + TabView { + id:tabViewMain anchors.fill: parent anchors.margins: 8 + visible: true + Tab { + //id:tabDisplay title: qsTr("Display") + asynchronous: true + //onLoaded: progressBar.visible=false + onStatusChanged: trackProgress() DisplayTab { anchors.fill: parent } } Tab { + //id:tabFont title: qsTr("Fonts") + asynchronous: true + onStatusChanged: trackProgress() FontsTab { anchors.fill: parent } } Tab { title: qsTr("Tests") + asynchronous: true + onStatusChanged: trackProgress() TestsTab { anchors.fill: parent } } + } //TabView + ProgressBar { + id: progressBar + anchors.centerIn: parent } + + }