Advertisement
Guest User

Untitled

a guest
Jun 14th, 2020
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import QtQuick 2.12
  2. import QtQuick.Controls 2.4
  3. import QtQuick.Window 2.11
  4. import QtQuick.Dialogs 1.2
  5.  
  6. ApplicationWindow {
  7. id: root
  8. visible: true
  9. width: 640
  10. height: 480
  11. title: qsTr("Hello World")
  12.  
  13. Button {
  14. id: chooseButton
  15. anchors.centerIn: parent
  16.  
  17. text: "Select file";
  18. FileDialog {
  19. id: fileChoose
  20. onAccepted: {
  21. result.text = fileUrl
  22. chooseButton.visible = false
  23. }
  24. }
  25. onClicked: {
  26. fileChoose.open()
  27. }
  28. }
  29. TextArea {
  30. id: result
  31. visible: !chooseButton.visible
  32. width: parent.width/2
  33. wrapMode: Text.WrapAtWordBoundaryOrAnywhere
  34. height: parent.height/2
  35. anchors.centerIn: parent
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement