Browse Source

make all qml incubations synchronous

Seems to be a bug with 5.11 where async loading leads to strange errors,
i.e. a crash on an error report of a non existing property that actually
exists...

Check for validity in future versions!
pull/2/head
Skycoder42 7 years ago
parent
commit
b53be20664
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 8
      src/imports/mvvmquick/DialogPresenter.qml
  2. 2
      src/imports/mvvmquick/InputDialog.qml
  3. 5
      src/imports/mvvmquick/SettingsView.qml
  4. 2
      src/imports/mvvmquick/qqmlquickpresenter.cpp

8
src/imports/mvvmquick/DialogPresenter.qml

@ -184,7 +184,7 @@ QtObject {
var props = config.viewProperties;
props["msgConfig"] = config;
props["msgResult"] = result;
var incubator = _msgBoxComponent.incubateObject(rootItem, props);
var incubator = _msgBoxComponent.incubateObject(rootItem, props, Qt.Synchronous);
return incubator.status !== Component.Error;
}
@ -204,7 +204,7 @@ QtObject {
var props = config.viewProperties;
props["msgConfig"] = config;
props["msgResult"] = result;
var incubator = _inputComponent.incubateObject(rootItem, props);
var incubator = _inputComponent.incubateObject(rootItem, props, Qt.Synchronous);
return incubator.status !== Component.Error;
}
@ -226,9 +226,9 @@ QtObject {
props["msgResult"] = result;
var incubator = null;
if(config.subType == "folder")
incubator = _folderComponent.incubateObject(rootItem, props);
incubator = _folderComponent.incubateObject(rootItem, props, Qt.Synchronous);
else
incubator = _fileComponent.incubateObject(rootItem, props);
incubator = _fileComponent.incubateObject(rootItem, props, Qt.Synchronous);
return incubator.status !== Component.Error;
}
}

2
src/imports/mvvmquick/InputDialog.qml

@ -38,7 +38,7 @@ MsgBoxBase {
Loader {
id: _inputViewLoad
asynchronous: true
asynchronous: false
clip: true
visible: _inputViewLoad.item

5
src/imports/mvvmquick/SettingsView.qml

@ -258,11 +258,10 @@ Page {
onPresentOverview: _overviewComponent.incubateObject(_settingsStack, {
model: model,
showSections: hasSections
}, Qt.Asynchronous)
}, Qt.Synchronous)
onPresentSection: _sectionViewComponent.incubateObject(_settingsStack, {
model: model
}, Qt.Asynchronous)
}, Qt.Synchronous)
onCloseSettings: {
_settingsView.fullClose = true;
QuickPresenter.popView();

2
src/imports/mvvmquick/qqmlquickpresenter.cpp

@ -123,7 +123,7 @@ void QQmlQuickPresenter::present(ViewModel *viewModel, const QVariantHash &param
this, &QQmlQuickPresenter::loadingProgressChanged);
connect(_latestComponent, &QQmlComponent::statusChanged,
this, &QQmlQuickPresenter::statusChanged);
_latestComponent->loadUrl(viewUrl, QQmlComponent::Asynchronous);
_latestComponent->loadUrl(viewUrl, QQmlComponent::PreferSynchronous);
}
}

Loading…
Cancel
Save