add title & ok label
This commit is contained in:
parent
70cf4acd5b
commit
dda16db50a
@ -94,6 +94,9 @@ void DoricModalPlugin::alert(QString jsValueString, QString callbackId) {
|
||||
window->setProperty("plugin", QString::number((qint64)this));
|
||||
window->setProperty("callbackId", callbackId);
|
||||
|
||||
window->setProperty("title", titleVal.toString());
|
||||
window->setProperty("okLabel", okBtn.toString());
|
||||
|
||||
QQuickWindow *parentWindow =
|
||||
getContext()->getRootNode()->getRootView()->window();
|
||||
|
||||
|
@ -12,9 +12,19 @@ Window {
|
||||
property var plugin
|
||||
property var callbackId
|
||||
|
||||
property var title
|
||||
property var okLabel
|
||||
|
||||
onTitleChanged: {
|
||||
dialog.title = title
|
||||
}
|
||||
|
||||
onOkLabelChanged: {
|
||||
dialog.standardButton(Dialog.Ok).text = qsTrId(okLabel)
|
||||
}
|
||||
|
||||
Dialog {
|
||||
id: dialog
|
||||
title: "Title"
|
||||
standardButtons: Dialog.Ok
|
||||
modal: true
|
||||
|
||||
@ -33,6 +43,5 @@ Window {
|
||||
|
||||
Component.onCompleted: {
|
||||
dialog.open()
|
||||
dialog.standardButton(Dialog.Ok).text = qsTrId("OkLabel")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user