Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.5
- import QtQuick.Window 2.2
- import QtQuick.Controls 1.2
- import QtQuick.Dialogs 1.2
- Rectangle {
- visible: true
- width: 640
- height: 480
- MouseArea{
- anchors.fill: parent
- Text {
- id: titleText
- text: qsTr("Comment")
- anchors.fill: parent
- }
- onClicked: {
- commentDialog.visible = true;
- commentText.focus = true
- }
- }
- Dialog {
- id: commentDialog
- width: 400
- height: 250
- visible: false
- title: "Choose a date"
- standardButtons: StandardButton.Save | StandardButton.Cancel
- Text {
- id: cdTitleText
- text: qsTr("Comment")
- anchors.fill: parent
- }
- TextEdit{
- id: commentText
- width: 240
- font.family: "Helvetica"
- font.pointSize: 20
- color: "black"
- focus: true
- text: ""
- }
- onAccepted: console.log(commentText.text)
- onRejected: commentDialog.visible = false
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement