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