Explorar el Código

svg rendering for 5.12 too

Reinhard Russinger hace 5 años
padre
commit
4ecc015834
Se han modificado 8 ficheros con 98 adiciones y 41 borrados
  1. 9 1
      HMI_MainMenu.qml
  2. 5 0
      HMI_Settings.qml
  3. 2 0
      Main.qml
  4. 56 29
      Menu/MenuButton.qml
  5. 12 0
      Menu/MenuHeader.qml
  6. 10 4
      Start.qml
  7. 0 3
      images/AdminSettings.svg
  8. 4 4
      main.cpp

+ 9 - 1
HMI_MainMenu.qml

@@ -33,19 +33,25 @@ Item {
         width: parent.width
         width: parent.width
         height: parent.height - 2 * y
         height: parent.height - 2 * y
 
 
+        //border.color: "blue"
+        //border.width: 2
+
+
         GridLayout {
         GridLayout {
+            anchors.centerIn: parent
             anchors.fill: parent
             anchors.fill: parent
             columnSpacing: 0
             columnSpacing: 0
             rowSpacing: 0
             rowSpacing: 0
 
 
+            columns: 3
             rows: 2
             rows: 2
-            columns: 4
 
 
             Menu.MenuButton {
             Menu.MenuButton {
                 Layout.row: 0
                 Layout.row: 0
                 Layout.column: 0
                 Layout.column: 0
                 Layout.fillHeight: true
                 Layout.fillHeight: true
                 Layout.fillWidth: true
                 Layout.fillWidth: true
+                Layout.preferredWidth: parent.width / colums
                 //: ID:main_menu_hmi_settings Main Menu HMI Settings text
                 //: ID:main_menu_hmi_settings Main Menu HMI Settings text
                 menuText:  qsTrId("main_menu_hmi_settings") + transLoad.emptyString //qsTr("HMI - Einstellungen") + transLoad.emptyString
                 menuText:  qsTrId("main_menu_hmi_settings") + transLoad.emptyString //qsTr("HMI - Einstellungen") + transLoad.emptyString
                 menuQML: "/HMI_SettingsContainer.qml"
                 menuQML: "/HMI_SettingsContainer.qml"
@@ -75,6 +81,7 @@ Item {
                 Layout.column: 1
                 Layout.column: 1
                 Layout.fillHeight: true
                 Layout.fillHeight: true
                 Layout.fillWidth: true
                 Layout.fillWidth: true
+                Layout.preferredWidth: parent.width / colums
 
 
                 menuImage:  "/images/CamSettings.svg"
                 menuImage:  "/images/CamSettings.svg"
                 //: ID:main_menu_cam_settings Main Menu CAM Settings text
                 //: ID:main_menu_cam_settings Main Menu CAM Settings text
@@ -104,6 +111,7 @@ Item {
                 Layout.column: 2
                 Layout.column: 2
                 Layout.fillHeight: true
                 Layout.fillHeight: true
                 Layout.fillWidth: true
                 Layout.fillWidth: true
+                Layout.preferredWidth: parent.width / colums
 
 
                 menuImage:  "/images/AdminSettings.svg"
                 menuImage:  "/images/AdminSettings.svg"
                 //: ID:main_menu_admin_settings Main Menu Administrator Settings text
                 //: ID:main_menu_admin_settings Main Menu Administrator Settings text

+ 5 - 0
HMI_Settings.qml

@@ -312,6 +312,9 @@ Rectangle {
                     fillMode: Image.PreserveAspectFit
                     fillMode: Image.PreserveAspectFit
                     sourceSize.height: parent.height / 5
                     sourceSize.height: parent.height / 5
                     sourceSize.width: parent.height / 5
                     sourceSize.width: parent.height / 5
+                    height: sourceSize.height
+                    width:sourceSize.width
+
                 }
                 }
 
 
                 ListModel {
                 ListModel {
@@ -347,6 +350,8 @@ Rectangle {
                                 fillMode: Image.PreserveAspectFit
                                 fillMode: Image.PreserveAspectFit
                                 sourceSize.height: parent.height - parent.height * 0.25
                                 sourceSize.height: parent.height - parent.height * 0.25
                                 sourceSize.width: parent.width
                                 sourceSize.width: parent.width
+                                height: sourceSize.height
+                                width:sourceSize.width
 
 
                                 source: flag
                                 source: flag
                                 smooth: true
                                 smooth: true

+ 2 - 0
Main.qml

@@ -26,6 +26,8 @@ Window {
             fillMode: Image.PreserveAspectFit
             fillMode: Image.PreserveAspectFit
             sourceSize.width: parent.width
             sourceSize.width: parent.width
             sourceSize.height: parent.height
             sourceSize.height: parent.height
+            height: sourceSize.height
+            width:sourceSize.width
             visible: Globals.logoSplashVisible
             visible: Globals.logoSplashVisible
             Component.onCompleted: {
             Component.onCompleted: {
                 splashTIMER.running = true;
                 splashTIMER.running = true;

+ 56 - 29
Menu/MenuButton.qml

@@ -19,39 +19,66 @@ Button {
     width: parent.width
     width: parent.width
     height: parent.height
     height: parent.height
 
 
-    Image {
-        id: idIMG
+    background: Rectangle {
+        id: backrectBUTT
+        border.width: 0.0
+    }
+
+    Rectangle {
+        id: buttRECT
         anchors.centerIn: parent
         anchors.centerIn: parent
+        //border.color: "red"
+        //border.width: 2
 
 
-        fillMode: Image.PreserveAspectFit
-        source: menuImage
-        sourceSize.height: parent.height - parent.width * (parent.imgBorder / 100.0)
-        sourceSize.width: parent.width - parent.width * (parent.imgBorder / 100.0)
-
-        Text {
-            id: menTXT
-            anchors.bottom: parent.bottom
-            anchors.bottomMargin: 3
-            x: 2
-            width: parent.width - 2 * x
-            color: "white"
-            font.pixelSize: (parent.height * 0.21) / 2
-            wrapMode: Text.WordWrap
-            text: menuText
-        }
-    }
+        width: backrectBUTT.width  - backrectBUTT.width * (parent.imgBorder / 100.0)
+        height: backrectBUTT.height - backrectBUTT.height * (parent.imgBorder / 100.0)
 
 
-    HueSaturation {
-        id: idSaturation
-        anchors.fill: idIMG
-        source: idIMG
-        hue: 0.0
-        saturation: buttGreyed
-        lightness: 0.0
-    }
+        Image {
+            id: idIMG
+            anchors.centerIn: parent
+            anchors.fill: parent
+            source: menuImage
+            fillMode: Image.PreserveAspectFit
+            sourceSize: Qt.size(backrectBUTT.width ,
+                                backrectBUTT.height  )
 
 
-    background: Rectangle {
-        border.width: 0.0
+            width: backrectBUTT.width
+            height: backrectBUTT.height
+
+            onStatusChanged: {
+                if (status == Image.Ready) {
+                    console.log(menuImage + '---' + backrectBUTT.width + '  ' + backrectBUTT.height + '==' + paintedWidth + '  ' + paintedHeight);
+                }
+            }
+
+            Item {
+                anchors.centerIn: parent
+                width: idIMG.paintedWidth
+                height: idIMG.paintedHeight
+
+                Text {
+                    id: menTXT
+                    anchors.bottom: parent.bottom
+                    anchors.bottomMargin: 3
+                    x: 2
+                    width: parent.width - 2 * x
+                    color: "white"
+                    font.pixelSize: (parent.height * 0.21) / 2
+                    wrapMode: Text.WordWrap
+                    text: menuText
+
+                }
+            }
+        }
+
+        HueSaturation {
+            id: idSaturation
+            anchors.fill: idIMG
+            source: idIMG
+            hue: 0.0
+            saturation: buttGreyed
+            lightness: 0.0
+        }
     }
     }
 
 
     onClicked: {
     onClicked: {

+ 12 - 0
Menu/MenuHeader.qml

@@ -87,6 +87,8 @@ Item {
             source: buttUndoImage
             source: buttUndoImage
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+            height: sourceSize.height
+            width:sourceSize.width
         }
         }
         background: Rectangle {
         background: Rectangle {
             radius: buttRadius
             radius: buttRadius
@@ -115,6 +117,8 @@ Item {
             source: buttHomeImage
             source: buttHomeImage
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+            height: sourceSize.height
+            width:sourceSize.width
         }
         }
         background: Rectangle {
         background: Rectangle {
             radius: buttRadius
             radius: buttRadius
@@ -144,6 +148,8 @@ Item {
             source: buttLockImage
             source: buttLockImage
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+            height: sourceSize.height
+            width:sourceSize.width
         }
         }
         background: Rectangle {
         background: Rectangle {
             radius: buttRadius
             radius: buttRadius
@@ -179,6 +185,8 @@ Item {
             source: buttCamImage
             source: buttCamImage
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+            height: sourceSize.height
+            width:sourceSize.width
             visible: parent.visible
             visible: parent.visible
         }
         }
         background: Rectangle {
         background: Rectangle {
@@ -223,6 +231,8 @@ Item {
             source: buttCamImage
             source: buttCamImage
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+            height: sourceSize.height
+            width:sourceSize.width
             visible: parent.visible
             visible: parent.visible
         }
         }
         background: Rectangle {
         background: Rectangle {
@@ -259,6 +269,8 @@ Item {
         fillMode: Image.PreserveAspectFit
         fillMode: Image.PreserveAspectFit
         sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
         sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
         sourceSize.width: parent.width/3.0 - parent.width/3.0 * (buttImgBorder / 100.0)
         sourceSize.width: parent.width/3.0 - parent.width/3.0 * (buttImgBorder / 100.0)
+        height: sourceSize.height
+        width:sourceSize.width
     }
     }
 
 
     Text {
     Text {

+ 10 - 4
Start.qml

@@ -69,7 +69,7 @@ Rectangle {
         running: false
         running: false
         repeat: false
         repeat: false
         onTriggered: {
         onTriggered: {
-            testWebsite.appName = "curl -m 3 -Is " + camURL;
+            testWebsite.appName = "curl --insecure -m 3 -Is " + camURL;
             if(menuAREA.z === 1) {
             if(menuAREA.z === 1) {
                 testWebsite.launchScript();
                 testWebsite.launchScript();
             } else {
             } else {
@@ -121,7 +121,7 @@ Rectangle {
         urlchangeBUSY.visible = true;
         urlchangeBUSY.visible = true;
         camURL = whichCamSet();
         camURL = whichCamSet();
 
 
-        testWebsite.appName = "curl -m 3 -Is " + camURL;
+        testWebsite.appName = "curl --insecure -m 3 -Is " + camURL;
 
 
         testWebsite.launchScript();
         testWebsite.launchScript();
         console.debug("CAMURL Component.onCompleted :" + camURL);
         console.debug("CAMURL Component.onCompleted :" + camURL);
@@ -134,7 +134,7 @@ Rectangle {
                 console.debug("CAMURL onVisible changed :" + camURL);
                 console.debug("CAMURL onVisible changed :" + camURL);
                 camURL = whichCamSet();
                 camURL = whichCamSet();
 
 
-                testWebsite.appName = "curl -m 3 -Is " + camURL;
+                testWebsite.appName = "curl --insecure -m 3 -Is " + camURL;
 
 
                 testWebsite.launchScript();
                 testWebsite.launchScript();
                 console.debug("CAMURL onVisibleChanged :" + camURL);
                 console.debug("CAMURL onVisibleChanged :" + camURL);
@@ -261,6 +261,8 @@ Rectangle {
                             source: buttmenuArea
                             source: buttmenuArea
                             sourceSize.height: parent.height * 0.7 //- parent.height * (buttImgBorder / 100.0)
                             sourceSize.height: parent.height * 0.7 //- parent.height * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width * 0.7 //- parent.width * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width * 0.7 //- parent.width * (buttImgBorder / 100.0)
+                            height: sourceSize.height
+                            width:sourceSize.width
                             visible: parent.visible
                             visible: parent.visible
                         }
                         }
                     }
                     }
@@ -275,7 +277,7 @@ Rectangle {
                         onPressAndHold: {
                         onPressAndHold: {
                             camURL = whichCamSet();
                             camURL = whichCamSet();
 
 
-                            testWebsite.appName = "curl -m 3 -Is " + camURL;
+                            testWebsite.appName = "curl --insecure -m 3 -Is " + camURL;
 
 
                             testWebsite.launchScript();
                             testWebsite.launchScript();
 
 
@@ -336,6 +338,8 @@ Rectangle {
                             source: buttCamImage
                             source: buttCamImage
                             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
                             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+                            height: sourceSize.height
+                            width:sourceSize.width
                             visible: parent.visible
                             visible: parent.visible
                         }
                         }
                         background: Rectangle {
                         background: Rectangle {
@@ -387,6 +391,8 @@ Rectangle {
                             source: buttCamImage
                             source: buttCamImage
                             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
                             sourceSize.height: parent.height - parent.height * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
                             sourceSize.width: parent.width - parent.width * (buttImgBorder / 100.0)
+                            height: sourceSize.height
+                            width:sourceSize.width
                             visible: parent.visible
                             visible: parent.visible
                         }
                         }
                         background: Rectangle {
                         background: Rectangle {

+ 0 - 3
images/AdminSettings.svg

@@ -9,9 +9,6 @@
    xmlns="http://www.w3.org/2000/svg"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="24.99995mm"
-   height="24.99995mm"
-   viewBox="0 0 88.582501 88.582501"
    id="svg3595"
    id="svg3595"
    version="1.1"
    version="1.1"
    inkscape:version="0.91 r13725"
    inkscape:version="0.91 r13725"

+ 4 - 4
main.cpp

@@ -180,12 +180,12 @@ int main(int argc, char *argv[])
     QSize availSize = app.primaryScreen()->availableSize();
     QSize availSize = app.primaryScreen()->availableSize();
 
 
     if(QSysInfo::currentCpuArchitecture() == "x86_64") {
     if(QSysInfo::currentCpuArchitecture() == "x86_64") {
-        item->setProperty("width", 640);
-        item->setProperty("height", 480);
+        //item->setProperty("width", 640);
+        //item->setProperty("height", 480);
         //item->setProperty("width", 480);
         //item->setProperty("width", 480);
         //item->setProperty("height", 272);
         //item->setProperty("height", 272);
-        //item->setProperty("width", 800);
-        //item->setProperty("height", 480);
+        item->setProperty("width", 800);
+        item->setProperty("height", 480);
         //        item->setProperty("width", 1280);
         //        item->setProperty("width", 1280);
         //        item->setProperty("height", 800);
         //        item->setProperty("height", 800);
     } else {
     } else {