main.qml
author sl
Wed, 28 May 2014 20:14:23 +0200
changeset 13 40da62e57d85
parent 7 b3cce7791326
child 17 aa257fdcd093
permissions -rw-r--r--
Fixing qml warnings.
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@0
    17
    title: qsTr("MiniDisplay Manager")
sl@0
    18
    SystemPalette { id: palette }
sl@7
    19
    //Component.onCompleted: progressBar.visible=tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready
sl@0
    20
sl@8
    21
    statusBar: DisplayStatusBar {}
sl@8
    22
sl@8
    23
sl@0
    24
    Settings {
sl@0
    25
        property alias x: appWindow.x
sl@0
    26
        property alias y: appWindow.y
sl@0
    27
        property alias width: appWindow.width
sl@0
    28
        property alias height: appWindow.height
sl@0
    29
    }
sl@0
    30
sl@0
    31
    /*
sl@0
    32
    menuBar: MenuBar {
sl@0
    33
        Menu {
sl@0
    34
            title: qsTr("File")
sl@0
    35
            MenuItem {
sl@0
    36
                text: qsTr("Exit")
sl@0
    37
                onTriggered: Qt.quit();
sl@0
    38
            }
sl@0
    39
        }
sl@0
    40
sl@0
    41
    }*/
sl@0
    42
sl@7
    43
    function trackProgress()
sl@7
    44
    {
sl@7
    45
        progressBar.value = tabViewMain.getTab(tabViewMain.currentIndex).progress;
sl@7
    46
        progressBar.visible = tabViewMain.getTab(tabViewMain.currentIndex).status !== Loader.Ready;
sl@7
    47
    }
sl@7
    48
sl@8
    49
    /*
sl@8
    50
    function updateDisplayStatus()
sl@8
    51
    {
sl@8
    52
        if (display.isOpen)
sl@8
    53
        {
sl@8
    54
            labelDisplayStatus.text=qsTr("Connected");
sl@8
    55
        }
sl@8
    56
        else
sl@8
    57
        {
sl@8
    58
            labelDisplayStatus.text=qsTr("Disconnected");
sl@8
    59
        }
sl@8
    60
sl@8
    61
        labelDisplayVendor.text=display.vendor;
sl@8
    62
        labelDisplayProduct.text=display.product;
sl@8
    63
        labelDisplaySerialNumber.text=display.serialNumber;
sl@8
    64
    }*/
sl@8
    65
sl@8
    66
sl@5
    67
    MiniDisplay {
sl@5
    68
        id: display
sl@8
    69
        //onOpened:updateDisplayStatus()
sl@8
    70
        //onClosed:updateDisplayStatus()
sl@8
    71
        //onOpenError:{ updateDisplayStatus(); labelDisplayStatus.text=qsTr("Connection error");}
sl@5
    72
    }
sl@5
    73
sl@7
    74
sl@0
    75
    TabView {
sl@7
    76
        id:tabViewMain
sl@0
    77
        anchors.fill: parent
sl@0
    78
        anchors.margins: 8
sl@7
    79
        visible: true
sl@7
    80
sl@2
    81
        Tab {
sl@7
    82
            //id:tabDisplay
sl@2
    83
            title: qsTr("Display")
sl@7
    84
            asynchronous: true
sl@7
    85
            //onLoaded: progressBar.visible=false
sl@7
    86
            onStatusChanged: trackProgress()
sl@2
    87
            DisplayTab { anchors.fill: parent }
sl@2
    88
        }
sl@2
    89
        Tab {
sl@7
    90
            //id:tabFont
sl@0
    91
            title: qsTr("Fonts")
sl@7
    92
            asynchronous: true
sl@7
    93
            onStatusChanged: trackProgress()
sl@0
    94
            FontsTab { anchors.fill: parent }
sl@0
    95
        }
sl@0
    96
        Tab {
sl@0
    97
            title: qsTr("Tests")
sl@7
    98
            asynchronous: true
sl@7
    99
            onStatusChanged: trackProgress()
sl@0
   100
            TestsTab { anchors.fill: parent }
sl@0
   101
        }
sl@7
   102
    } //TabView
sl@0
   103
sl@7
   104
    ProgressBar {
sl@7
   105
        id: progressBar
sl@7
   106
        anchors.centerIn: parent
sl@0
   107
    }
sl@7
   108
sl@7
   109
sl@0
   110
}