Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.13 KB | None | 0 0
  1. import QtQuick 2.5
  2. import QtQuick.Window 2.2
  3. import QtQuick.Controls 1.2
  4. import QtQuick.Dialogs 1.2
  5.  
  6. Rectangle {
  7.     visible: true
  8.     width: 640
  9.     height: 480
  10.  
  11.     MouseArea{
  12.         anchors.fill: parent
  13.  
  14.         Text {
  15.             id: titleText
  16.             text: qsTr("Comment")
  17.             anchors.fill: parent
  18.         }
  19.  
  20.         onClicked: {
  21.             commentDialog.visible = true;
  22.             commentText.focus = true
  23.         }
  24.     }
  25.  
  26.  
  27.  
  28.     Dialog {
  29.         id: commentDialog
  30.         width: 400
  31.         height: 250
  32.         visible: false
  33.         title: "Choose a date"
  34.         standardButtons: StandardButton.Save | StandardButton.Cancel
  35.  
  36.         Text {
  37.             id: cdTitleText
  38.             text: qsTr("Comment")
  39.             anchors.fill: parent
  40.         }
  41.  
  42.         TextEdit{
  43.             id: commentText
  44.             width: 240
  45.             font.family: "Helvetica"
  46.             font.pointSize: 20
  47.             color: "black"
  48.             focus: true
  49.             text: ""
  50.         }
  51.  
  52.         onAccepted: console.log(commentText.text)
  53.         onRejected: commentDialog.visible = false
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement