Migration of QtMvvm from github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
687 B

import QtQuick 2.10
import QtQuick.Controls 2.3
import de.skycoder42.QtMvvm.Core 1.0
QtObject {
id: _dialogPresenter
property Item rootItem: null
function showDialog(config, result) {
if(config.type == "msgbox") {
createMsgBox(config, result)
return true;
} else
return false;
}
property Component _msgBoxComponent: Component {
MsgBox {
id: __msgBox
Component.onCompleted: __msgBox.open()
}
}
function createMsgBox(config, result) {
var props = config.viewProperties;
props["msgConfig"] = config;
props["msgResult"] = result;
var incubator = _msgBoxComponent.incubateObject(rootItem, props);
return incubator.status !== Component.Error;
}
}