Advertisement
Guest User

buttons problem

a guest
Jan 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.12 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: 10
  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.                     anchors.fill: parent
  26.                     Layout.alignment: Layout.Center
  27.                     //Layout.minimumHeight: parent.height - 110
  28.                     anchors.topMargin: refreshButton.height + 15
  29.                     anchors.bottomMargin: backButton.height + 15
  30.                     height: parent.height - (refreshButton.height + backButton.height + 30)
  31.                     width: parent.width
  32.                     flickableDirection: Flickable.VerticalFlick
  33.                     boundsBehavior: Flickable.StopAtBounds
  34.  
  35.                     model: 100
  36.                     delegate: ItemDelegate {
  37.                         text: "Item " + index
  38.                     }
  39.                     ScrollBar.vertical: ScrollBar {}
  40.                 }
  41.  
  42.                 Button {
  43.                     Layout.alignment: Qt.AlignCenter
  44.                     id: backButton
  45.                     text: "Back"
  46.                     Layout.preferredWidth: 140
  47.                     Layout.minimumWidth: 50
  48.                     height: 60
  49.                     highlighted: true
  50.                     Material.accent: Material.Teal
  51.                     x: parent.width / 2 - width / 2
  52.                     y: parent.height / 2 - height / 2
  53.  
  54.                     onClicked: {
  55.                         view.pop()
  56.                     }
  57.                 }
  58.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement