This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/example/doric/resources/alert.qml

56 lines
1.0 KiB
QML
Raw Normal View History

2021-04-22 11:43:48 +08:00
import QtQuick 2.12
import QtQuick.Controls 2.12
2021-04-26 21:21:59 +08:00
ApplicationWindow {
2021-04-22 11:43:48 +08:00
id: window
flags: flags | Qt.WindowStaysOnTopHint | Qt.Tool | Qt.FramelessWindowHint
visible: true
modality: Qt.ApplicationModal
property var pointer
property var plugin
property var callbackId
2021-04-22 11:48:22 +08:00
property var title
2021-04-22 14:00:56 +08:00
property var msg
2021-04-22 11:48:22 +08:00
property var okLabel
onTitleChanged: {
dialog.title = title
}
2021-04-22 14:00:56 +08:00
onMsgChanged: {
content.text = msg
}
2021-04-22 11:48:22 +08:00
onOkLabelChanged: {
dialog.standardButton(Dialog.Ok).text = qsTrId(okLabel)
}
2021-04-22 11:43:48 +08:00
Dialog {
id: dialog
standardButtons: Dialog.Ok
modal: true
2021-04-22 14:00:56 +08:00
contentItem: Text {
id: content
}
2021-04-22 11:43:48 +08:00
onAccepted: {
2021-04-22 13:42:38 +08:00
dialogBridge.onAccepted(pointer, plugin, callbackId)
2021-04-22 11:43:48 +08:00
}
onWidthChanged: {
window.width = implicitWidth
}
onHeightChanged: {
window.height = implicitHeight
}
}
Component.onCompleted: {
dialog.open()
}
}