diff --git a/examples/mvvmcore/SampleCore/sampleviewmodel.cpp b/examples/mvvmcore/SampleCore/sampleviewmodel.cpp index 0b82ca3..0765010 100644 --- a/examples/mvvmcore/SampleCore/sampleviewmodel.cpp +++ b/examples/mvvmcore/SampleCore/sampleviewmodel.cpp @@ -43,7 +43,7 @@ void SampleViewModel::setName(QString name) if (_name == name) return; - _name = name; + _name = std::move(name); emit nameChanged(_name); if(_active && _eventService) { _eventService->removeEvent(_eventId); @@ -88,8 +88,8 @@ void SampleViewModel::getInput() void SampleViewModel::getFiles() { - QtMvvm::getOpenFiles(this, [this](QList urls) { - for(auto url : urls) + QtMvvm::getOpenFiles(this, [this](const QList &urls) { + for(const auto &url : urls) addEvent(url.toString()); }, tr("Open Files:"), {QStringLiteral("text/plain"), QStringLiteral("application/pdf")}); } diff --git a/src/imports/mvvmquick/MsgBoxBase.qml b/src/imports/mvvmquick/MsgBoxBase.qml index d8759d3..183c93f 100644 --- a/src/imports/mvvmquick/MsgBoxBase.qml +++ b/src/imports/mvvmquick/MsgBoxBase.qml @@ -69,8 +69,9 @@ AlertDialog { standardButtons: msgConfig.buttons onStandardButtonsChanged: { - for(var key in msgConfig.buttonTexts) + Object.keys(msgConfig.buttonTexts).forEach(function(key) { standardButton(key).text = msgConfig.buttonTexts[key] + }); } onClicked: { diff --git a/src/imports/mvvmquick/settingsuibuilder.cpp b/src/imports/mvvmquick/settingsuibuilder.cpp index bd812be..05bf0a7 100644 --- a/src/imports/mvvmquick/settingsuibuilder.cpp +++ b/src/imports/mvvmquick/settingsuibuilder.cpp @@ -39,7 +39,9 @@ void SettingsUiBuilder::loadSection(const SettingsElements::Section §ion) { auto inputFactory = QuickPresenterPrivate::currentPresenter()->inputViewFactory(); _entryModel->setup(section, _viewModel, inputFactory); +#ifndef QT_NO_DEBUG qmlDebug(this) << "Loaded section " << section.title; +#endif emit presentSection(_entryFilterModel); } @@ -48,7 +50,9 @@ void SettingsUiBuilder::showDialog(const QString &key, const QString &title, con if(type == QStringLiteral("action")) _viewModel->callAction(key, properties.value(QStringLiteral("args")).toMap()); else { +#ifndef QT_NO_DEBUG qmlDebug(this) << "Creating input dialog for settings entry " << key; +#endif getInput(title + tr(":"), QString(), qUtf8Printable(type), this, [this, key](const QVariant &value) { if(value.isValid()) _viewModel->saveValue(key, value);