forked from qt-creator/qt-creator
QmlPreview: fix use an init language
Change-Id: I2d2774d88a237871eaddacd18c55490e9bd953ef Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qmldebug/qmldebugcommandlinearguments.h>
|
#include <qmldebug/qmldebugcommandlinearguments.h>
|
||||||
|
#include <qmlprojectmanager/qmlmultilanguageaspect.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
@@ -110,9 +111,10 @@ QmlPreviewRunner::QmlPreviewRunner(RunControl *runControl, const QmlPreviewRunne
|
|||||||
this, [this, settings]() {
|
this, [this, settings]() {
|
||||||
if (settings.zoomFactor > 0)
|
if (settings.zoomFactor > 0)
|
||||||
emit zoom(settings.zoomFactor);
|
emit zoom(settings.zoomFactor);
|
||||||
if (!settings.language.isEmpty())
|
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current()) {
|
||||||
emit language(settings.language);
|
if (!multiLanguageAspect->currentLocale().isEmpty())
|
||||||
|
emit language(multiLanguageAspect->currentLocale());
|
||||||
|
}
|
||||||
emit ready();
|
emit ready();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -15,7 +15,6 @@ struct QmlPreviewRunnerSetting
|
|||||||
QmlPreviewFileClassifier fileClassifier;
|
QmlPreviewFileClassifier fileClassifier;
|
||||||
QmlPreviewFpsHandler fpsHandler;
|
QmlPreviewFpsHandler fpsHandler;
|
||||||
float zoomFactor = -1.0;
|
float zoomFactor = -1.0;
|
||||||
QString language;
|
|
||||||
QmlDebugTranslationClientFactoryFunction createDebugTranslationClientMethod;
|
QmlDebugTranslationClientFactoryFunction createDebugTranslationClientMethod;
|
||||||
QmlPreviewRefreshTranslationFunction refreshTranslationsFunction;
|
QmlPreviewRefreshTranslationFunction refreshTranslationsFunction;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user