Advertisement
Guest User

Untitled

a guest
Oct 31st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.80 KB | None | 0 0
  1. import QtQuick 2.9
  2. import QtQuick.Controls 2.2
  3. import QtQuick.Layouts 1.3
  4.  
  5. ApplicationWindow {
  6.     visible: true
  7.     width: 640
  8.     height: 480
  9.     title: qsTr("Hello World")
  10.  
  11.     header: Rectangle {
  12.         color: "red"
  13.  
  14.         height: 80
  15.     }
  16.  
  17.     Button {
  18.         id: dialogButton
  19.         text: "Click me!"
  20.  
  21.         onClicked: quitDialog.open()
  22.     }
  23.  
  24.  
  25.     Button {
  26.         id: quitButton
  27.         text: "Quit"
  28.  
  29.         onClicked: Qt.quit()
  30.  
  31.         anchors.left: dialogButton.right
  32.         anchors.leftMargin: 10
  33.     }
  34.  
  35.     Dialog {
  36.         id: quitDialog
  37.         width: 500
  38.         height: 275
  39.  
  40.         modal: true
  41.  
  42.         x: (parent.width - width) / 2
  43.         y: visible ? 0 : -height
  44.  
  45.         Behavior on y { NumberAnimation { easing.type: Easing.OutQuad } }
  46.  
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement