author | sl |
Wed, 04 Jun 2014 19:30:54 +0200 | |
changeset 34 | f2c87f0cfabe |
parent 8 | 9543e1703afb |
permissions | -rw-r--r-- |
sl@0 | 1 |
import QtQuick 2.2 |
sl@0 | 2 |
import QtQuick.Controls 1.2 |
sl@0 | 3 |
import QtPositioning 5.3 |
sl@0 | 4 |
import QtWinExtras 1.0 |
sl@0 | 5 |
import QtQuick.Dialogs 1.2 |
sl@0 | 6 |
import QtQuick.Window 2.1 |
sl@0 | 7 |
import Qt.labs.settings 1.0 |
sl@5 | 8 |
import MiniDisplay 1.0 |
sl@8 | 9 |
import QtQuick.Layouts 1.1 |
sl@0 | 10 |
|
sl@0 | 11 |
|
sl@0 | 12 |
ApplicationWindow { |
sl@0 | 13 |
id: appWindow |
sl@0 | 14 |
visible: true |
sl@0 | 15 |
width: 640 |
sl@0 | 16 |
height: 480 |
sl@17 | 17 |
minimumWidth: 400 |
sl@17 | 18 |
minimumHeight: 400 |
sl@0 | 19 |
title: qsTr("MiniDisplay Manager") |
sl@0 | 20 |
SystemPalette { id: palette } |
sl@7 | 21 |
//Component.onCompleted: progressBar.visible=tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready |
sl@0 | 22 |
|
sl@8 | 23 |
statusBar: DisplayStatusBar {} |
sl@8 | 24 |
|
sl@8 | 25 |
|
sl@0 | 26 |
Settings { |
sl@0 | 27 |
property alias x: appWindow.x |
sl@0 | 28 |
property alias y: appWindow.y |
sl@0 | 29 |
property alias width: appWindow.width |
sl@0 | 30 |
property alias height: appWindow.height |
sl@0 | 31 |
} |
sl@0 | 32 |
|
sl@0 | 33 |
/* |
sl@0 | 34 |
menuBar: MenuBar { |
sl@0 | 35 |
Menu { |
sl@0 | 36 |
title: qsTr("File") |
sl@0 | 37 |
MenuItem { |
sl@0 | 38 |
text: qsTr("Exit") |
sl@0 | 39 |
onTriggered: Qt.quit(); |
sl@0 | 40 |
} |
sl@0 | 41 |
} |
sl@0 | 42 |
|
sl@0 | 43 |
}*/ |
sl@0 | 44 |
|
sl@7 | 45 |
function trackProgress() |
sl@7 | 46 |
{ |
sl@7 | 47 |
progressBar.value = tabViewMain.getTab(tabViewMain.currentIndex).progress; |
sl@7 | 48 |
progressBar.visible = tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready; |
sl@7 | 49 |
} |
sl@7 | 50 |
|
sl@8 | 51 |
/* |
sl@8 | 52 |
function updateDisplayStatus() |
sl@8 | 53 |
{ |
sl@8 | 54 |
if (display.isOpen) |
sl@8 | 55 |
{ |
sl@8 | 56 |
labelDisplayStatus.text=qsTr("Connected"); |
sl@8 | 57 |
} |
sl@8 | 58 |
else |
sl@8 | 59 |
{ |
sl@8 | 60 |
labelDisplayStatus.text=qsTr("Disconnected"); |
sl@8 | 61 |
} |
sl@8 | 62 |
|
sl@8 | 63 |
labelDisplayVendor.text=display.vendor; |
sl@8 | 64 |
labelDisplayProduct.text=display.product; |
sl@8 | 65 |
labelDisplaySerialNumber.text=display.serialNumber; |
sl@8 | 66 |
}*/ |
sl@8 | 67 |
|
sl@8 | 68 |
|
sl@5 | 69 |
MiniDisplay { |
sl@5 | 70 |
id: display |
sl@8 | 71 |
//onOpened:updateDisplayStatus() |
sl@8 | 72 |
//onClosed:updateDisplayStatus() |
sl@8 | 73 |
//onOpenError:{ updateDisplayStatus(); labelDisplayStatus.text=qsTr("Connection error");} |
sl@5 | 74 |
} |
sl@5 | 75 |
|
sl@7 | 76 |
|
sl@0 | 77 |
TabView { |
sl@7 | 78 |
id:tabViewMain |
sl@0 | 79 |
anchors.fill: parent |
sl@0 | 80 |
anchors.margins: 8 |
sl@7 | 81 |
visible: true |
sl@7 | 82 |
|
sl@2 | 83 |
Tab { |
sl@7 | 84 |
//id:tabDisplay |
sl@2 | 85 |
title: qsTr("Display") |
sl@7 | 86 |
asynchronous: true |
sl@7 | 87 |
//onLoaded: progressBar.visible=false |
sl@7 | 88 |
onStatusChanged: trackProgress() |
sl@2 | 89 |
DisplayTab { anchors.fill: parent } |
sl@2 | 90 |
} |
sl@2 | 91 |
Tab { |
sl@7 | 92 |
//id:tabFont |
sl@0 | 93 |
title: qsTr("Fonts") |
sl@7 | 94 |
asynchronous: true |
sl@7 | 95 |
onStatusChanged: trackProgress() |
sl@0 | 96 |
FontsTab { anchors.fill: parent } |
sl@0 | 97 |
} |
sl@0 | 98 |
Tab { |
sl@0 | 99 |
title: qsTr("Tests") |
sl@7 | 100 |
asynchronous: true |
sl@7 | 101 |
onStatusChanged: trackProgress() |
sl@0 | 102 |
TestsTab { anchors.fill: parent } |
sl@0 | 103 |
} |
sl@7 | 104 |
} //TabView |
sl@0 | 105 |
|
sl@7 | 106 |
ProgressBar { |
sl@7 | 107 |
id: progressBar |
sl@7 | 108 |
anchors.centerIn: parent |
sl@0 | 109 |
} |
sl@7 | 110 |
|
sl@7 | 111 |
|
sl@0 | 112 |
} |