AlertDialog.qml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2016 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. import QtQuick
  4. import QtQuick.Controls
  5. import QtQuick.Layouts
  6. Dialog {
  7. property alias text: message.text
  8. property bool handled: false
  9. title: qsTr("Alert Dialog")
  10. modal: false
  11. anchors.centerIn: parent
  12. objectName: "alertDialog"
  13. ColumnLayout {
  14. id: rootLayout
  15. anchors.fill: parent
  16. anchors.margins: 4
  17. property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins
  18. property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins
  19. property int doubleMargins: anchors.margins * 2
  20. SystemPalette { id: palette; colorGroup: SystemPalette.Active }
  21. RowLayout {
  22. Layout.alignment: Qt.AlignRight
  23. spacing: 8
  24. Image {
  25. source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/information.png"
  26. }
  27. Label {
  28. id: message
  29. Layout.fillWidth: true
  30. color: palette.windowText
  31. textFormat: Text.PlainText
  32. }
  33. }
  34. Item {
  35. Layout.fillHeight: true
  36. }
  37. Button {
  38. Layout.alignment: Qt.AlignHCenter
  39. text: qsTr("OK")
  40. onClicked: accept()
  41. }
  42. }
  43. }