Advertisement
Guest User

Resize problem

a guest
Jan 19th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.00 KB | None | 0 0
  1. ColumnLayout {
  2.                 width: window.width
  3.                 height: window.height
  4.                 spacing: 2
  5.                 anchors.fill: parent
  6.  
  7.                 Button {
  8.                     Layout.alignment: Qt.AlignCenter
  9.                     id: refreshButton
  10.                     text: "Refresh"
  11.                     Layout.preferredWidth: 140
  12.                     Layout.minimumWidth: 50
  13.                     height: 60
  14.                     highlighted: true
  15.                     Material.accent: Material.Teal
  16.                     x: parent.width / 2 - width / 2
  17.                     y: parent.height / 2 - height / 2
  18.  
  19.                     onClicked: {
  20.                         console.log("Refresh")
  21.                     }
  22.                 }
  23.  
  24.                 ListView {
  25.                     //Layout.fillWidth: true
  26.                     anchors.topMargin: refreshButton.height + 5
  27.                     anchors.bottomMargin: backButton.height + 5
  28.                     height: parent.height - (refreshButton.height + backButton.height)
  29.                     width: parent.width
  30.                     flickableDirection: Flickable.VerticalFlick
  31.                     boundsBehavior: Flickable.StopAtBounds
  32.  
  33.                     model: 100
  34.                     delegate: ItemDelegate {
  35.                         text: "Item " + index
  36.                     }
  37.                     ScrollBar.vertical: ScrollBar {}
  38.                 }
  39.  
  40.                 Button {
  41.                     Layout.alignment: Qt.AlignCenter
  42.                     id: backButton
  43.                     text: "Back"
  44.                     Layout.preferredWidth: 140
  45.                     Layout.minimumWidth: 50
  46.                     height: 60
  47.                     highlighted: true
  48.                     Material.accent: Material.Teal
  49.                     x: parent.width / 2 - width / 2
  50.                     y: parent.height / 2 - height / 2
  51.  
  52.                     onClicked: {
  53.                         view.pop()
  54.                     }
  55.                 }
  56.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement