forked from qt-creator/qt-creator
Support QML preview with qmlproject on android
Change-Id: I53a074d2064ddd2a20e745250d9620cd1969928b Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -47,6 +47,8 @@ AndroidDevice::AndroidDevice()
|
||||
{
|
||||
setDisplayName(QCoreApplication::translate("Android::Internal::AndroidDevice", "Run on Android"));
|
||||
setDeviceState(DeviceReadyToUse);
|
||||
setQmlsceneCommand(
|
||||
"org.qtproject.example.qmlscene/org.qtproject.qt5.android.bindings.QtActivity");
|
||||
}
|
||||
|
||||
AndroidDevice::AndroidDevice(const AndroidDevice &other)
|
||||
|
@@ -50,7 +50,9 @@
|
||||
#endif
|
||||
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
@@ -93,6 +95,19 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
|
||||
RunControl::registerWorker<AndroidRunConfiguration, AndroidQmlToolingSupport>(
|
||||
QML_PREVIEW_RUN_MODE);
|
||||
|
||||
RunControl::registerWorker(QML_PREVIEW_RUN_MODE, [](RunControl *runControl) -> RunWorker* {
|
||||
const Runnable runnable = runControl->runConfiguration()->runnable();
|
||||
QTC_ASSERT(runnable.is<StandardRunnable>(), return nullptr);
|
||||
const StandardRunnable standardRunnable = runnable.as<StandardRunnable>();
|
||||
return new AndroidQmlToolingSupport(runControl, standardRunnable.executable,
|
||||
standardRunnable.commandLineArguments);
|
||||
}, [](RunConfiguration *runConfig) {
|
||||
return runConfig->isEnabled()
|
||||
&& runConfig->id().name().startsWith("QmlProjectManager.QmlRunConfiguration")
|
||||
&& DeviceTypeKitInformation::deviceTypeId(runConfig->target()->kit())
|
||||
== Android::Constants::ANDROID_DEVICE_TYPE;
|
||||
});
|
||||
|
||||
d = new AndroidPluginPrivate;
|
||||
|
||||
KitManager::registerKitInformation(new Internal::AndroidGdbServerKitInformation);
|
||||
|
Reference in New Issue
Block a user