Advertisement
Guest User

Untitled

a guest
Oct 30th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 3.11 KB | None | 0 0
  1. import QtQuick 2.9
  2. import QtQuick.Layouts 1.3
  3. import QtQuick.Controls 1.4
  4. import QtQuick.Controls 2.4
  5.  
  6. Row {
  7.     id: reihe
  8.     spacing: 20
  9.     height: 200
  10.     width: app.width
  11.     Rectangle {
  12.         id: content
  13.         //color: "red"
  14.         anchors.fill:parent
  15.         //anchors: { left:parent.left; right:parent.right }
  16.         //height: column.implicitHeight+ 5
  17.         border.width: 2
  18.         border.color: "lightsteelblue"
  19.         radius: 10
  20.         clip: true
  21.         Behavior on scale { NumberAnimation { easing.type: Easing.OutQuad } }
  22.  
  23.         MouseArea {
  24.             anchors.fill:parent
  25.             onPressed: {
  26.                 parent.scale= 0.9
  27.                 image.opacity= 1
  28.  
  29.             }
  30.             onReleased: {
  31.                 parent.scale= 1.0
  32.                 image.opacity= 0.3
  33.             }
  34.         }
  35.  
  36.         RowLayout{
  37.             spacing: 10
  38.             Rectangle{
  39.                 clip: true
  40.                 width: 200
  41.                 height: reihe.height
  42.                 //color: "red"
  43.                 Image {
  44.                     id: image
  45.                     anchors.fill: parent
  46.                     source: modelData.image
  47.                     smooth: true
  48.                     fillMode: Image.PreserveAspectFit
  49.                     opacity: 0.3
  50.                     Behavior on opacity { NumberAnimation { easing.type:Easing.OutQuad }}
  51.                 }
  52.             }
  53.             Column {
  54.                 Text {
  55.                     text: 'Name: ' + modelData.forename + ' ' + modelData.name
  56.                 }
  57.                 Text {
  58.                     text: 'Studiengang: ' + modelData.course
  59.                 }
  60.                 Text {
  61.                     text: 'Alter: ' + modelData.age
  62.                 }
  63.                 Text {
  64.                     text: 'Matrikelnummer: ' + modelData.matriculationNumber
  65.                 }
  66.                 Text {
  67.                     text: 'Semester: #' + modelData.semseter
  68.                 }
  69.  
  70.  
  71.                 //            Text {
  72.                 //                text: 'Model Index: ' + index
  73.                 //            }
  74.             }
  75.  
  76.             ScrollView{
  77.                 visible: false
  78.                 height: reihe.height-5
  79.                 //ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
  80.                 Column{
  81.                 //ListModel{
  82.                     Repeater{
  83.                         model: modelData.modules
  84.                         Column{
  85.                             Text {
  86.                                 text: 'Modul: ' + modelData.name
  87.                             }
  88.                             Text {
  89.                                 text: 'Kürzel: ' + modelData.identificationCode
  90.                             }
  91.                             Text {
  92.                                 text: 'Schwierigkeit: ' + modelData.severity
  93.                             }
  94.                             Text {
  95.                                 text: 'Lerngruppe: ' + modelData.lernenGroup
  96.                             }
  97.                         }
  98.                     }
  99.                 }
  100.             }
  101.         }
  102.     }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement