errordialog.qml 723 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. import Qt 4.7
  5. Rectangle {
  6. id: page
  7. property Item text: dialogText
  8. property int lineNumber: 0
  9. signal closed
  10. function forceClose() {
  11. page.closed(lineNumber);
  12. page.opacity = 0;
  13. }
  14. function show(line, txt) {
  15. page.lineNumber = line
  16. dialogText.text = txt;
  17. page.opacity = 1;
  18. }
  19. width: dialogText.width + 20; height: dialogText.height + 20
  20. color: "white"
  21. border.width: 1
  22. opacity: 0
  23. Behavior on opacity { NumberAnimation { duration: 1000 } }
  24. Text { id: dialogText; anchors.centerIn: parent; text: "Error dialog" }
  25. MouseArea { anchors.fill: parent; onClicked: forceClose() }
  26. }