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