57 property Item rootItem: null
69 function showDialog(config, result) {
70 if(config.type ==
"msgbox")
71 return createMsgBox(config, result)
72 else if(config.type ==
"input")
73 return createInput(config, result)
74 else if(config.type ==
"file")
75 return createFile(config, result)
89 function closeAction() {
90 if(_popups.length > 0) {
91 _popups[_popups.length - 1].reject();
98 property var _popups: []
100 property Component _msgBoxComponent: MsgBox {
104 var index = _popups.indexOf(__msgBox);
107 _dialogPresenter._popups.splice(index, 1);
111 Component.onCompleted: {
112 _popups.push(__msgBox)
118 property Component _inputComponent: InputDialog {
122 var index = _popups.indexOf(__input);
125 _dialogPresenter._popups.splice(index, 1);
129 Component.onCompleted: {
130 _popups.push(__input)
136 property Component _fileComponent:
FileDialog {
140 var index = _popups.indexOf(__file);
143 _dialogPresenter._popups.splice(index, 1);
147 Component.onCompleted: {
158 var index = _popups.indexOf(__folder);
161 _dialogPresenter._popups.splice(index, 1);
165 Component.onCompleted: {
166 _popups.push(__folder)
183 function createMsgBox(config, result) {
184 var props = config.viewProperties;
185 props[
"msgConfig"] = config;
186 props[
"msgResult"] = result;
187 var incubator = _msgBoxComponent.incubateObject(rootItem, props);
188 return incubator.status !== Component.Error;
203 function createInput(config, result) {
204 var props = config.viewProperties;
205 props[
"msgConfig"] = config;
206 props[
"msgResult"] = result;
207 var incubator = _inputComponent.incubateObject(rootItem, props);
208 return incubator.status !== Component.Error;
223 function createFile(config, result) {
224 var props = config.viewProperties;
225 props[
"msgConfig"] = config;
226 props[
"msgResult"] = result;
227 var incubator = null;
228 if(config.subType ==
"folder")
229 incubator = _folderComponent.incubateObject(rootItem, props);
231 incubator = _fileComponent.incubateObject(rootItem, props);
232 return incubator.status !== Component.Error;
The QML import for the QtMvvmCore QML module.
The QML import for the QtMvvmQuick QML module.
void open()
Opens the file chooser by sending the show intent.
A folder dialog implementation based on the labs folder dialog.
A file dialog implementation based on the labs file dialog.