Advertisement
hemanthpusarla

Untitled

Apr 8th, 2023
98
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 12.59 KB | Gaming | 0 0
  1. import QtQuick 2.12
  2. import QtQuick.Window 2.12
  3. import QtQuick.Controls.Styles 1.4
  4.  
  5.  
  6. import QtQuick.Controls 1.4
  7. import QtQuick.Controls 2.3
  8. import QtQuick.Layouts 1.3
  9. import QtGraphicalEffects 1.0
  10. import QtQuick.Shapes 1.4
  11.  
  12.  
  13.  
  14. Window {
  15.     id:mainWindow
  16.     width: 800
  17.     height: 600
  18.     visible: true
  19.     title: qsTr("Hello World")
  20.  
  21.     Rectangle{
  22.         id:rectid
  23.         width:781
  24.         height: 506
  25.         gradient: Gradient {
  26.             GradientStop{
  27.                 position: 0.0;color: "#f5f5f5"
  28.             }
  29.             GradientStop{
  30.                 position: 0.5;color: "#c8c8c8"
  31.             }
  32.             GradientStop{
  33.                 position: 1.0;color: "#9b9b9b"
  34.             }
  35.  
  36.  
  37.         }
  38.         border.color: "black"
  39.         border.width: 1
  40.         anchors.verticalCenterOffset: -51
  41.         anchors.horizontalCenterOffset: 7
  42.         radius: 20
  43.         anchors.centerIn: parent
  44.         Text {
  45.             id: alarm1
  46.             text: qsTr("Disinfection history")
  47.             x: 70
  48.             y: 10
  49.             width: 60; height:150;
  50.             color: "#3A3B3C"
  51.             //anchors.left: parent
  52.             anchors {
  53.                 left:parent.right
  54.             }
  55.  
  56.             font.pixelSize: 35
  57.             anchors.leftMargin: -722
  58.             // font.bold: true
  59.         }
  60.         Rectangle{
  61.             id:alarm2
  62.             width: 100; height:45;
  63.             x: 669
  64.             y: 2
  65.             antialiasing: true
  66.             smooth: true
  67.             gradient: Gradient
  68.             {
  69.                 GradientStop
  70.                 {
  71.                     id: ueButtonGradientStopPosition0
  72.  
  73.                     position: 0
  74.                     color: "#d1d1d1"
  75.                 }   // GradientStop
  76.  
  77.                 GradientStop
  78.                 {
  79.                     id: ueButtonGradientStopPosition1
  80.  
  81.                     position: 0.5
  82.                     color: "#b8b8b8"
  83.                 }   // GradientStop
  84.                 GradientStop
  85.                 {
  86.                     id: ueButtonGradientStopPosition2
  87.  
  88.                     position: 1.0
  89.                     color: "#a8a8a8"
  90.                 }   // GradientStop
  91.             }   // Gradient
  92.  
  93.             border.color: "#7b7b7b"
  94.             border.width: 2
  95.             radius: 15
  96.             Text {
  97.                 id: tx
  98.                 x: 34
  99.                 y: -2
  100.                 width: 99
  101.                 height: 47
  102.                 text: qsTr("X")
  103.                 color: "#4d4d4d"
  104.                 font.bold: false
  105.                 font.pointSize: 32
  106.                 // palette.tx: "#4d4d4d"
  107.  
  108.             }
  109.  
  110.             MouseArea{
  111.                 anchors.fill: parent
  112.                 anchors.rightMargin: 3
  113.                 anchors.bottomMargin: -2
  114.                 anchors.leftMargin: 5
  115.                 anchors.topMargin: 2
  116.                 onClicked:{
  117.  
  118.                     close()
  119.                 }
  120.  
  121.  
  122.             }
  123.         }
  124.     //}
  125.  
  126.  
  127.     Rectangle {
  128.         id: rectangle1
  129.         z:1
  130.         width: 705
  131.         height: 390
  132.         anchors.centerIn: parent
  133.         radius:20
  134.  
  135.  
  136.         TableView {
  137.             id: tableView
  138.             y: 47
  139.             clip: true
  140.             visible: true
  141.             anchors.horizontalCenterOffset: -13
  142.  
  143.             width: 0.95 * parent.width; height: 0.8 * parent.height
  144.             anchors.horizontalCenter: parent.horizontalCenter
  145.             verticalScrollBarPolicy: 2
  146.             horizontalScrollBarPolicy: 0
  147.             anchors.rightMargin: 8
  148.             antialiasing: false
  149.             headerVisible: true
  150.             frameVisible: false
  151.  
  152.  
  153.  
  154.             rowDelegate: Rectangle {
  155.                 color: (styleData.row & 1) ? "#FFFFFF" : "#FFFFFF"
  156.                 height: 40
  157.             }
  158.  
  159.  
  160.             TableViewColumn {
  161.                 id: titleColumn
  162.                 title: "Date/Time"
  163.                 role: "title"
  164.                 movable: true
  165.                 resizable: true
  166.                 width: 300
  167.                 delegate: Rectangle {
  168. //                    border.color: "black"
  169. //                    border.width: 2
  170.                     z:1
  171.                     x: 80
  172.                     y:10
  173.                     color: "transparent"
  174.                     Text {
  175.                         text: styleData.value
  176.                         font.bold: true
  177.                         font.pointSize: 12
  178.                         horizontalAlignment: Text.AlignLeft
  179.                         verticalAlignment: Text.AlignVCenter
  180.                         anchors.fill: parent
  181.                     }
  182.                 }
  183.             }
  184.  
  185.  
  186.             TableViewColumn {
  187.                 id: valueColumn
  188.                 title: "program"
  189.                 role: "value"
  190.                 movable: false
  191.                 resizable: false
  192.                 width: 150
  193.                 delegate: Rectangle {
  194. //                    border.color: "Black"
  195. //                    border.width: 2
  196.                     z:1
  197.                     color: "transparent"
  198.                     Text {
  199.                         font.bold: true
  200.                         font.pointSize: 12
  201.                         elide: styleData.elideMode
  202.                         text: styleData.value
  203.                         anchors.centerIn: parent
  204.                     }
  205.                 }
  206.             }
  207.  
  208.  
  209.             TableViewColumn {
  210.                 id: valueColumn1
  211.                 title: "status"
  212.                 role: "value1"
  213.                 movable: false
  214.                 resizable: false
  215.                 width: 150
  216.                 delegate: Rectangle {
  217. //                    border.color: "Black"
  218. //                    border.width:2
  219.                     z:1
  220.                     color: "transparent"
  221.                     Text {
  222.                         font.bold: true
  223.                         font.pointSize: 12
  224.                         elide: styleData.elideMode
  225.                         text: styleData.value
  226.                         anchors.centerIn: parent
  227.                     }
  228.                 }
  229.             }
  230.  
  231.  
  232.             headerDelegate: Rectangle {
  233.                 height: 30
  234.                 //border.color: "black"
  235.                 Text {
  236.                     text: styleData.value
  237.                     font.bold: true
  238.                     font.pointSize: 12
  239.                     horizontalAlignment: Text.AlignHCenter
  240.                     verticalAlignment: Text.AlignVCenter
  241.                     anchors.fill: parent
  242.  
  243.                 }
  244.             }
  245.  
  246.             itemDelegate: Rectangle {
  247.  
  248.                 Rectangle {
  249.                     anchors {
  250.                         right: parent.right
  251.                         top: parent.top
  252.                         bottom: parent.bottom
  253.                     }
  254.                     width: 1
  255.                     color: "black"
  256.                 }
  257.             }
  258.  
  259.  
  260.  
  261.             model: sourceModel
  262.  
  263.             style: TableViewStyle {
  264.  
  265.                 frame: Rectangle{
  266.                     border.color: "transparent"
  267.                     border.width: 1
  268.                     anchors.top: parent.top
  269.                     anchors.bottom: parent.bottom
  270.                     anchors.bottomMargin: 1
  271.                     //color: "transparent"
  272.                     color: "#0D82C8"
  273.                     //color: "black"
  274.                     radius: 15
  275.  
  276.                 }
  277.  
  278.  
  279.                 handle: Rectangle {
  280.  
  281.                     id: handleRect
  282.                     color: "transparent"
  283.                     anchors.bottom: parent.bottom
  284.                     anchors.bottomMargin: 3
  285.                     anchors.top: parent.top
  286.                     anchors.topMargin: 2
  287.                     implicitWidth: 33 // This will be overridden by the width of the scrollbar
  288.                     implicitHeight: 50 // This will be overridden based on the size of the scrollbar
  289.  
  290.                     Rectangle {
  291.                         anchors.horizontalCenter: handleRect.horizontalCenter
  292.                         anchors.bottom: handleRect.bottom
  293.                         anchors.bottomMargin: 0
  294.                         anchors.top: handleRect.top
  295.                         anchors.topMargin: 0
  296.                         anchors.rightMargin: 5
  297.                         implicitWidth: 31 // This will be overridden by the width of the scrollbar
  298.                         implicitHeight: 35
  299.                         color: "#0D82C8"
  300.                         border.width: 1
  301.                         radius:15
  302.                     }
  303.                 }
  304.  
  305.                 scrollBarBackground: Rectangle {
  306.                     anchors.bottom: parent.bottom
  307.                     anchors.bottomMargin: 0
  308.                     anchors.top: parent.top
  309.                     anchors.topMargin: 0
  310.                     implicitWidth: 33
  311.                     implicitHeight: 45
  312.                     color: "#B9B9B9"
  313.                     //border.color: "black"
  314.                     border.width: 0
  315.                     radius:30
  316.                     //rotation:180
  317.                     gradient: Gradient {
  318.                         orientation: Gradient.Horizontal
  319.                         GradientStop {
  320.                             position: 0.02283
  321.                             color: "#6c6969"
  322.                         }
  323.  
  324.                         GradientStop {
  325.                             position: 1
  326.                             color: "#ffffff"
  327.                         }
  328.                     }
  329.  
  330.  
  331.                 }
  332.                 //}
  333.                 decrementControl: Rectangle {
  334.                     //border.color: "transparent"
  335.                     //border.color: "black"
  336.                     border.width: 0
  337.                     radius:10
  338.                     implicitWidth: 30
  339.                     anchors.left: parent.left
  340.                     anchors.leftMargin: 2
  341.                     implicitHeight: 25
  342.                     color: "#0D82C8"
  343.                     Image {
  344.                         anchors.centerIn: parent
  345.                         width:15
  346.                         height:15
  347.                         rotation: 0
  348.                         source: "images/caret-arrow-up.png"
  349.                     }
  350.                 }
  351.  
  352.                 incrementControl: Rectangle {
  353.                     implicitWidth: 30
  354.                     anchors.left: parent.left
  355.                     anchors.leftMargin: 2
  356.                     implicitHeight: 25
  357.                     color: "#0D82C8"
  358.                     radius: 10
  359.                     Image {
  360.                         anchors.centerIn: parent
  361.                         width:15
  362.                         height:15
  363.                         rotation: 180
  364.                         source: "images/caret-arrow-up.png"
  365.                     }
  366.                     //border.color: "black"
  367.                     border.width: 0
  368.                 }
  369.             }
  370.  
  371.         }
  372.  
  373.         ListModel {
  374.             id: sourceModel
  375.  
  376.             ListElement {
  377.                 title: "10/19/2014 12.45pm"
  378.                 value:"Heat"
  379.                 value1: "user aborted"
  380.             }
  381.             ListElement {
  382.                 title: "10/18/2014 12.45pm"
  383.                 value: "citric"
  384.                 value1: "completed"
  385.             }
  386.             ListElement {
  387.                 title: "10/17/2014 12.45pm"
  388.                 value: "perace"
  389.                 value1: "completed"
  390.  
  391.             }
  392.             ListElement {
  393.                 title: "10/16/2014 12.45pm"
  394.                 value: "heat"
  395.                 value1: "completed"
  396.             }
  397.             ListElement {
  398.                 title: "10/15/2014 12.45pm"
  399.                 value: "short heat citric"
  400.                 value1: "completed"
  401.             }
  402.             ListElement {
  403.                 title: "10/14/2014 12.45pm"
  404.                 value: "Hypochl 10%"
  405.                 value1: "completed"
  406.             }
  407.             ListElement {
  408.                 title: "10/13/2014 12.45pm"
  409.                 value: "citric 20%"
  410.                 value1: "incomplete"
  411.             }
  412.             ListElement {
  413.                 title: "10/12/2014 12.45pm"
  414.                 value: "Heat"
  415.                 value1: "completed"
  416.             }
  417.             ListElement {
  418.                 title: "10/12/2014 12.45pm"
  419.                 value: "Heat"
  420.                 value1: "completed"
  421.             }
  422.             ListElement {
  423.                 title: "10/12/2014 12.45pm"
  424.                 value: "Heat"
  425.                 value1: "completed"
  426.             }
  427.             ListElement {
  428.                 title: "10/12/2014 12.45pm"
  429.                 value: "Heat"
  430.                 value1: "completed"
  431.             }
  432.  
  433.  
  434.         }
  435.     }
  436. }
  437. }
  438.  
Tags: QML
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement