Implements previewing qml preview for a qmlproject

To run it requires either designpreview.apk installed
on the device or apks placed in
<QTCREATATORDIR>/share/qtcreator/android/qtdesignviewer/
Apk filename should follow designpreview_$ARCH.apk

Task-number: QAA-512
Change-Id: Ida955b0fac519112d4623166677a7ba8e9afb1f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Piotr Mikolajczyk
2021-08-16 13:48:26 +02:00
parent c2aeec7e86
commit 261a39cbbd
10 changed files with 586 additions and 17 deletions

View File

@@ -60,6 +60,8 @@
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/baseqtversion.h>
#include <android/androidconstants.h>
#include <QAction>
using namespace ProjectExplorer;
@@ -217,8 +219,12 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
connect(action, &QAction::triggered, this, [this]() {
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current())
m_localeIsoCode = multiLanguageAspect->currentLocale();
ProjectExplorerPlugin::runStartupProject(Constants::QML_PREVIEW_RUN_MODE);
bool skipDeploy = false;
const Kit *kit = SessionManager::startupTarget()->kit();
if (SessionManager::startupTarget() && kit)
skipDeploy = kit->
supportedPlatforms().contains(Android::Constants::ANDROID_DEVICE_TYPE);
ProjectExplorerPlugin::runStartupProject(Constants::QML_PREVIEW_RUN_MODE, skipDeploy);
});
menu->addAction(
Core::ActionManager::registerAction(action, "QmlPreview.RunPreview"),