XrErrorDialog.qml 778 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright (C) 2024 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick
  4. import QtQuick.Dialogs
  5. Item {
  6. function run(title, message) {
  7. var w = win.createObject();
  8. w.messageTitle = title;
  9. w.messageText = message;
  10. w.run();
  11. }
  12. Component {
  13. id: win
  14. Window {
  15. property alias messageTitle: msg.title
  16. property alias messageText: msg.text
  17. function run() { msg.open() }
  18. visible: true
  19. visibility: Window.Maximized
  20. MessageDialog {
  21. id: msg
  22. buttons: MessageDialog.Ok
  23. onAccepted: Qt.quit()
  24. onRejected: Qt.quit()
  25. }
  26. }
  27. }
  28. }