Advertisement
Guest User

main

a guest
Feb 18th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.89 KB | None | 0 0
  1. import QtQuick 2.12
  2. import QtQuick.Window 2.12
  3. import QtQuick.Controls 2.14
  4. import QtGraphicalEffects 1.0
  5.  
  6. Window {
  7.     visible: true
  8.     width: 640
  9.     height: 480
  10.     title: qsTr("Hello World")
  11.  
  12.     ListModel {
  13.             id: devModel
  14.             ListElement {
  15.                 hostname: "Apple"
  16.                 model_name: "N90UG"
  17.                 status: "good"
  18.                 date_install: "18.01.2020"
  19.                 date_change: "18.01.2020"
  20.             }
  21.             ListElement {
  22.                 hostname: "Samsung"
  23.                 model_name: "N547KL"
  24.                 status: "good"
  25.                 date_install: "18.01.2020"
  26.                 date_change: "18.01.2020"
  27.             }
  28.             ListElement {
  29.                 hostname: "Nokia"
  30.                 model_name: "Mj809H"
  31.                 status: "good"
  32.                 date_install: "18.01.2020"
  33.                 date_change: "18.01.2020"
  34.             }
  35.         }
  36.  
  37.     ListView {
  38.         id: listExample
  39.         anchors.fill: parent
  40.         visible: true
  41.         spacing: 6
  42.  
  43.         model: devModel
  44.  
  45.         delegate: PropertiesView {
  46.             id: delegateElement
  47.             anchors.left: parent.left
  48.             anchors.leftMargin: 10
  49.             anchors.right: parent.right
  50.             anchors.rightMargin: 10
  51.  
  52.             background: Rectangle {
  53.                 id: elementDevice
  54.                 implicitWidth: 100
  55.                 implicitHeight: 40
  56.                 opacity: enabled ? 1 : 0.3
  57.                 color: delegateElement.down ? "#dddedf" : "#eeeeee"
  58.             }
  59.  
  60.             DropShadow {
  61.                 anchors.fill: parent
  62.                 cached: true
  63.                 horizontalOffset: 3
  64.                 verticalOffset: 3
  65.                 radius: 8.0
  66.                 samples: 16
  67.                 color: "#80000000"
  68.                 source: parent
  69.             }
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement