forked from qt-creator/qt-creator
QmlProfiler: Adapt QmlProfilerRunControlFactory to Analyzer changes
Change-Id: I8047cdb3fc65df2139c1a5770218c48e83ef5f5a Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
@@ -27,9 +27,6 @@
|
|||||||
#include "qmlprofilerplugin.h"
|
#include "qmlprofilerplugin.h"
|
||||||
#include "qmlprofilerruncontrol.h"
|
#include "qmlprofilerruncontrol.h"
|
||||||
|
|
||||||
#include <analyzerbase/analyzermanager.h>
|
|
||||||
#include <analyzerbase/analyzerruncontrol.h>
|
|
||||||
#include <analyzerbase/analyzerstartparameters.h>
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/localapplicationrunconfiguration.h>
|
#include <projectexplorer/localapplicationrunconfiguration.h>
|
||||||
#include <projectexplorer/environmentaspect.h>
|
#include <projectexplorer/environmentaspect.h>
|
||||||
@@ -44,51 +41,6 @@
|
|||||||
using namespace QmlProfiler;
|
using namespace QmlProfiler;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
Analyzer::AnalyzerRunControl *LocalQmlProfilerRunner::createLocalRunControl(
|
|
||||||
RunConfiguration *runConfiguration,
|
|
||||||
const Analyzer::AnalyzerStartParameters &sp,
|
|
||||||
QString *errorMessage)
|
|
||||||
{
|
|
||||||
// only desktop device is supported
|
|
||||||
const IDevice::ConstPtr device = DeviceKitInformation::device(
|
|
||||||
runConfiguration->target()->kit());
|
|
||||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
|
||||||
|
|
||||||
Analyzer::AnalyzerRunControl *rc = Analyzer::AnalyzerManager::createRunControl(
|
|
||||||
sp, runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
|
||||||
QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
|
|
||||||
if (!engine) {
|
|
||||||
delete rc;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Configuration conf;
|
|
||||||
conf.executable = sp.debuggee;
|
|
||||||
conf.executableArguments = sp.debuggeeArgs;
|
|
||||||
conf.workingDirectory = rc->workingDirectory();
|
|
||||||
conf.socket = sp.analyzerSocket;
|
|
||||||
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
|
|
||||||
conf.environment = environment->environment();
|
|
||||||
conf.port = sp.analyzerPort;
|
|
||||||
|
|
||||||
if (conf.executable.isEmpty()) {
|
|
||||||
if (errorMessage)
|
|
||||||
*errorMessage = tr("No executable file to launch.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalQmlProfilerRunner *runner = new LocalQmlProfilerRunner(conf, engine);
|
|
||||||
|
|
||||||
QObject::connect(runner, &LocalQmlProfilerRunner::stopped,
|
|
||||||
engine, &QmlProfilerRunControl::notifyRemoteFinished);
|
|
||||||
QObject::connect(runner, &LocalQmlProfilerRunner::appendMessage,
|
|
||||||
engine, &QmlProfilerRunControl::logApplicationMessage);
|
|
||||||
QObject::connect(engine, &Analyzer::AnalyzerRunControl::starting,
|
|
||||||
runner, &LocalQmlProfilerRunner::start);
|
|
||||||
QObject::connect(rc, &RunControl::finished, runner, &LocalQmlProfilerRunner::stop);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString LocalQmlProfilerRunner::findFreeSocket()
|
QString LocalQmlProfilerRunner::findFreeSocket()
|
||||||
{
|
{
|
||||||
QTemporaryFile file;
|
QTemporaryFile file;
|
||||||
@@ -120,6 +72,14 @@ LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuratio
|
|||||||
{
|
{
|
||||||
connect(&m_launcher, &ApplicationLauncher::appendMessage,
|
connect(&m_launcher, &ApplicationLauncher::appendMessage,
|
||||||
this, &LocalQmlProfilerRunner::appendMessage);
|
this, &LocalQmlProfilerRunner::appendMessage);
|
||||||
|
connect(this, &LocalQmlProfilerRunner::stopped,
|
||||||
|
engine, &QmlProfilerRunControl::notifyRemoteFinished);
|
||||||
|
connect(this, &LocalQmlProfilerRunner::appendMessage,
|
||||||
|
engine, &QmlProfilerRunControl::logApplicationMessage);
|
||||||
|
connect(engine, &Analyzer::AnalyzerRunControl::starting,
|
||||||
|
this, &LocalQmlProfilerRunner::start);
|
||||||
|
connect(engine, &RunControl::finished,
|
||||||
|
this, &LocalQmlProfilerRunner::stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalQmlProfilerRunner::~LocalQmlProfilerRunner()
|
LocalQmlProfilerRunner::~LocalQmlProfilerRunner()
|
||||||
|
|||||||
@@ -30,12 +30,6 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <projectexplorer/applicationlauncher.h>
|
#include <projectexplorer/applicationlauncher.h>
|
||||||
|
|
||||||
namespace ProjectExplorer { class RunConfiguration; }
|
|
||||||
namespace Analyzer {
|
|
||||||
class AnalyzerStartParameters;
|
|
||||||
class AnalyzerRunControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
|
||||||
class QmlProfilerRunControl;
|
class QmlProfilerRunControl;
|
||||||
@@ -53,29 +47,22 @@ public:
|
|||||||
Utils::Environment environment;
|
Utils::Environment environment;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Analyzer::AnalyzerRunControl *createLocalRunControl(
|
LocalQmlProfilerRunner(const Configuration &configuration, QmlProfilerRunControl *engine);
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
~LocalQmlProfilerRunner();
|
||||||
const Analyzer::AnalyzerStartParameters &sp,
|
|
||||||
QString *errorMessage);
|
|
||||||
|
|
||||||
static quint16 findFreePort(QString &host);
|
static quint16 findFreePort(QString &host);
|
||||||
static QString findFreeSocket();
|
static QString findFreeSocket();
|
||||||
|
|
||||||
~LocalQmlProfilerRunner();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void started();
|
void started();
|
||||||
void stopped();
|
void stopped();
|
||||||
void appendMessage(const QString &message, Utils::OutputFormat format);
|
void appendMessage(const QString &message, Utils::OutputFormat format);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void spontaneousStop(int exitCode, QProcess::ExitStatus status);
|
void spontaneousStop(int exitCode, QProcess::ExitStatus status);
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
private:
|
|
||||||
LocalQmlProfilerRunner(const Configuration &configuration, QmlProfilerRunControl *engine);
|
|
||||||
|
|
||||||
Configuration m_configuration;
|
Configuration m_configuration;
|
||||||
ProjectExplorer::ApplicationLauncher m_launcher;
|
ProjectExplorer::ApplicationLauncher m_launcher;
|
||||||
QmlProfilerRunControl *m_engine;
|
QmlProfilerRunControl *m_engine;
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
|||||||
|
|
||||||
auto tool = new QmlProfilerTool(this);
|
auto tool = new QmlProfilerTool(this);
|
||||||
auto widgetCreator = [tool] { return tool->createWidgets(); };
|
auto widgetCreator = [tool] { return tool->createWidgets(); };
|
||||||
auto runControlCreator = [tool](const AnalyzerStartParameters &sp,
|
auto runControlCreator = [tool](const AnalyzerStartParameters &,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id) {
|
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id) {
|
||||||
return tool->createRunControl(sp, runConfiguration);
|
return tool->createRunControl(runConfiguration);
|
||||||
};
|
};
|
||||||
|
|
||||||
AnalyzerAction *action = 0;
|
AnalyzerAction *action = 0;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "qmlprofilerruncontrol.h"
|
#include "qmlprofilerruncontrol.h"
|
||||||
|
|
||||||
#include "localqmlprofilerrunner.h"
|
#include "localqmlprofilerrunner.h"
|
||||||
|
#include "qmlprofilertool.h"
|
||||||
|
|
||||||
#include <analyzerbase/analyzermanager.h>
|
#include <analyzerbase/analyzermanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -61,6 +62,7 @@ namespace QmlProfiler {
|
|||||||
class QmlProfilerRunControl::QmlProfilerRunControlPrivate
|
class QmlProfilerRunControl::QmlProfilerRunControlPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Internal::QmlProfilerTool *m_tool = 0;
|
||||||
QmlProfilerStateManager *m_profilerState = 0;
|
QmlProfilerStateManager *m_profilerState = 0;
|
||||||
QTimer m_noDebugOutputTimer;
|
QTimer m_noDebugOutputTimer;
|
||||||
QmlDebug::QmlOutputParser m_outputParser;
|
QmlDebug::QmlOutputParser m_outputParser;
|
||||||
@@ -71,10 +73,12 @@ public:
|
|||||||
// QmlProfilerRunControl
|
// QmlProfilerRunControl
|
||||||
//
|
//
|
||||||
|
|
||||||
QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration)
|
QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration,
|
||||||
|
Internal::QmlProfilerTool *tool)
|
||||||
: AnalyzerRunControl(runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
|
: AnalyzerRunControl(runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
|
||||||
, d(new QmlProfilerRunControlPrivate)
|
, d(new QmlProfilerRunControlPrivate)
|
||||||
{
|
{
|
||||||
|
d->m_tool = tool;
|
||||||
// Only wait 4 seconds for the 'Waiting for connection' on application output, then just try to connect
|
// Only wait 4 seconds for the 'Waiting for connection' on application output, then just try to connect
|
||||||
// (application output might be redirected / blocked)
|
// (application output might be redirected / blocked)
|
||||||
d->m_noDebugOutputTimer.setSingleShot(true);
|
d->m_noDebugOutputTimer.setSingleShot(true);
|
||||||
@@ -248,6 +252,11 @@ void QmlProfilerRunControl::registerProfilerStateManager( QmlProfilerStateManage
|
|||||||
this, &QmlProfilerRunControl::profilerStateChanged);
|
this, &QmlProfilerRunControl::profilerStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlProfilerRunControl::finalizeSetup()
|
||||||
|
{
|
||||||
|
d->m_tool->finalizeRunControl(this);
|
||||||
|
}
|
||||||
|
|
||||||
void QmlProfilerRunControl::profilerStateChanged()
|
void QmlProfilerRunControl::profilerStateChanged()
|
||||||
{
|
{
|
||||||
switch (d->m_profilerState->currentState()) {
|
switch (d->m_profilerState->currentState()) {
|
||||||
|
|||||||
@@ -33,15 +33,19 @@
|
|||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
|
||||||
|
namespace Internal { class QmlProfilerTool; }
|
||||||
|
|
||||||
class QmlProfilerRunControl : public Analyzer::AnalyzerRunControl
|
class QmlProfilerRunControl : public Analyzer::AnalyzerRunControl
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlProfilerRunControl(ProjectExplorer::RunConfiguration *runConfiguration);
|
QmlProfilerRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||||
|
Internal::QmlProfilerTool *tool);
|
||||||
~QmlProfilerRunControl();
|
~QmlProfilerRunControl();
|
||||||
|
|
||||||
void registerProfilerStateManager( QmlProfilerStateManager *profilerState );
|
void registerProfilerStateManager( QmlProfilerStateManager *profilerState );
|
||||||
|
void finalizeSetup();
|
||||||
|
|
||||||
void notifyRemoteSetupDone(quint16 port);
|
void notifyRemoteSetupDone(quint16 port);
|
||||||
StopResult stop();
|
StopResult stop();
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#include "qmlprofilerrunconfigurationaspect.h"
|
#include "qmlprofilerrunconfigurationaspect.h"
|
||||||
|
|
||||||
#include <analyzerbase/ianalyzertool.h>
|
#include <analyzerbase/ianalyzertool.h>
|
||||||
|
#include <analyzerbase/analyzerruncontrol.h>
|
||||||
|
#include <analyzerbase/analyzermanager.h>
|
||||||
|
|
||||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||||
|
|
||||||
@@ -61,38 +63,60 @@ bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Co
|
|||||||
&& (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
|
&& (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
|
||||||
}
|
}
|
||||||
|
|
||||||
static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration *runConfiguration)
|
|
||||||
{
|
|
||||||
AnalyzerStartParameters sp;
|
|
||||||
|
|
||||||
// FIXME: This is only used to communicate the connParams settings.
|
|
||||||
auto rc = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
|
||||||
QTC_ASSERT(rc, return sp);
|
|
||||||
sp.debuggee = rc->executable();
|
|
||||||
sp.debuggeeArgs = rc->commandLineArguments();
|
|
||||||
|
|
||||||
const QtSupport::BaseQtVersion *version =
|
|
||||||
QtSupport::QtKitInformation::qtVersion(runConfiguration->target()->kit());
|
|
||||||
if (version) {
|
|
||||||
QtSupport::QtVersionNumber versionNumber = version->qtVersion();
|
|
||||||
if (versionNumber.majorVersion >= 5 && versionNumber.minorVersion >= 6)
|
|
||||||
sp.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
|
|
||||||
else
|
|
||||||
sp.analyzerPort = LocalQmlProfilerRunner::findFreePort(sp.analyzerHost);
|
|
||||||
} else {
|
|
||||||
qWarning() << "Running QML profiler on Kit without Qt version??";
|
|
||||||
sp.analyzerPort = LocalQmlProfilerRunner::findFreePort(sp.analyzerHost);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sp;
|
|
||||||
}
|
|
||||||
|
|
||||||
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
|
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||||
|
|
||||||
AnalyzerStartParameters sp = createQmlProfilerStartParameters(runConfiguration);
|
Kit *kit = runConfiguration->target()->kit();
|
||||||
return LocalQmlProfilerRunner::createLocalRunControl(runConfiguration, sp, errorMessage);
|
// FIXME: This is only used to communicate the connParams settings.
|
||||||
|
auto localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||||
|
QTC_ASSERT(localRunConfiguration, return 0);
|
||||||
|
AnalyzerRunnable runnable;
|
||||||
|
runnable.debuggee = localRunConfiguration->executable();
|
||||||
|
runnable.debuggeeArgs = localRunConfiguration->commandLineArguments();
|
||||||
|
|
||||||
|
AnalyzerConnection connection;
|
||||||
|
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
||||||
|
if (version) {
|
||||||
|
QtSupport::QtVersionNumber versionNumber = version->qtVersion();
|
||||||
|
if (versionNumber.majorVersion >= 5 && versionNumber.minorVersion >= 6)
|
||||||
|
connection.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
|
||||||
|
else
|
||||||
|
connection.analyzerPort = LocalQmlProfilerRunner::findFreePort(connection.analyzerHost);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Running QML profiler on Kit without Qt version??";
|
||||||
|
connection.analyzerPort = LocalQmlProfilerRunner::findFreePort(connection.analyzerHost);
|
||||||
|
}
|
||||||
|
|
||||||
|
// only desktop device is supported
|
||||||
|
const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
|
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||||
|
|
||||||
|
auto runControl = qobject_cast<QmlProfilerRunControl *>
|
||||||
|
(AnalyzerManager::createRunControl(runConfiguration, mode));
|
||||||
|
QTC_ASSERT(runControl, return 0);
|
||||||
|
|
||||||
|
runControl->setRunnable(runnable);
|
||||||
|
runControl->setConnection(connection);
|
||||||
|
runControl->finalizeSetup();
|
||||||
|
|
||||||
|
LocalQmlProfilerRunner::Configuration conf;
|
||||||
|
conf.executable = runnable.debuggee;
|
||||||
|
conf.executableArguments = runnable.debuggeeArgs;
|
||||||
|
conf.workingDirectory = runControl->workingDirectory();
|
||||||
|
conf.socket = connection.analyzerSocket;
|
||||||
|
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
|
||||||
|
conf.environment = environment->environment();
|
||||||
|
conf.port = connection.analyzerPort;
|
||||||
|
|
||||||
|
if (conf.executable.isEmpty()) {
|
||||||
|
if (errorMessage)
|
||||||
|
*errorMessage = tr("No executable file to launch.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) new LocalQmlProfilerRunner(conf, runControl);
|
||||||
|
return runControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::IRunConfigurationAspect *
|
ProjectExplorer::IRunConfigurationAspect *
|
||||||
|
|||||||
@@ -201,8 +201,7 @@ static QString sysroot(RunConfiguration *runConfig)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl *QmlProfilerTool::createRunControl(RunConfiguration *runConfiguration)
|
||||||
RunConfiguration *runConfiguration)
|
|
||||||
{
|
{
|
||||||
QmlProfilerRunConfigurationAspect *aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
|
QmlProfilerRunConfigurationAspect *aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
|
||||||
runConfiguration->extraAspect(Constants::SETTINGS));
|
runConfiguration->extraAspect(Constants::SETTINGS));
|
||||||
@@ -215,22 +214,25 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
|||||||
settings->flushInterval() : 0);
|
settings->flushInterval() : 0);
|
||||||
d->m_profilerConnections->setAggregateTraces(settings->aggregateTraces());
|
d->m_profilerConnections->setAggregateTraces(settings->aggregateTraces());
|
||||||
|
|
||||||
QmlProfilerRunControl *engine = new QmlProfilerRunControl(runConfiguration);
|
return new QmlProfilerRunControl(runConfiguration, this);
|
||||||
engine->setRunnable(AnalyzerRunnable(sp));
|
}
|
||||||
engine->setConnection(AnalyzerConnection(sp));
|
|
||||||
|
|
||||||
engine->registerProfilerStateManager(d->m_profilerState);
|
void QmlProfilerTool::finalizeRunControl(QmlProfilerRunControl *runControl)
|
||||||
|
{
|
||||||
|
runControl->registerProfilerStateManager(d->m_profilerState);
|
||||||
|
|
||||||
// FIXME: Check that there's something sensible in sp.connParams
|
// FIXME: Check that there's something sensible in sp.connParams
|
||||||
if (!sp.analyzerSocket.isEmpty())
|
auto &connection = runControl->connection();
|
||||||
d->m_profilerConnections->setLocalSocket(sp.analyzerSocket);
|
if (!connection.analyzerSocket.isEmpty())
|
||||||
|
d->m_profilerConnections->setLocalSocket(connection.analyzerSocket);
|
||||||
else
|
else
|
||||||
d->m_profilerConnections->setTcpConnection(sp.analyzerHost, sp.analyzerPort);
|
d->m_profilerConnections->setTcpConnection(connection.analyzerHost, connection.analyzerPort);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize m_projectFinder
|
// Initialize m_projectFinder
|
||||||
//
|
//
|
||||||
|
|
||||||
|
RunConfiguration *runConfiguration = runControl->runConfiguration();
|
||||||
QString projectDirectory;
|
QString projectDirectory;
|
||||||
if (runConfiguration) {
|
if (runConfiguration) {
|
||||||
Project *project = runConfiguration->target()->project();
|
Project *project = runConfiguration->target()->project();
|
||||||
@@ -239,13 +241,11 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
|||||||
|
|
||||||
populateFileFinder(projectDirectory, sysroot(runConfiguration));
|
populateFileFinder(projectDirectory, sysroot(runConfiguration));
|
||||||
|
|
||||||
if (sp.analyzerSocket.isEmpty())
|
if (connection.analyzerSocket.isEmpty())
|
||||||
connect(engine, &QmlProfilerRunControl::processRunning,
|
connect(runControl, &QmlProfilerRunControl::processRunning,
|
||||||
d->m_profilerConnections, &QmlProfilerClientManager::connectTcpClient);
|
d->m_profilerConnections, &QmlProfilerClientManager::connectTcpClient);
|
||||||
connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionFailed,
|
connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionFailed,
|
||||||
engine, &QmlProfilerRunControl::cancelProcess);
|
runControl, &QmlProfilerRunControl::cancelProcess);
|
||||||
|
|
||||||
return engine;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *QmlProfilerTool::createWidgets()
|
QWidget *QmlProfilerTool::createWidgets()
|
||||||
@@ -516,17 +516,20 @@ void QmlProfilerTool::startRemoteTool()
|
|||||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port);
|
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port);
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalyzerStartParameters sp;
|
AnalyzerConnection connection;
|
||||||
|
|
||||||
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
if (device) {
|
if (device) {
|
||||||
sp.connParams = device->sshParameters();
|
connection.connParams = device->sshParameters();
|
||||||
sp.analyzerHost = device->qmlProfilerHost();
|
connection.analyzerHost = device->qmlProfilerHost();
|
||||||
}
|
}
|
||||||
sp.analyzerPort = port;
|
connection.analyzerPort = port;
|
||||||
|
|
||||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(0));
|
||||||
ProjectExplorerPlugin::startRunControl(rc, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
runControl->setConnection(connection);
|
||||||
|
runControl->finalizeSetup();
|
||||||
|
|
||||||
|
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerTool::logState(const QString &msg)
|
void QmlProfilerTool::logState(const QString &msg)
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ class QMessageBox;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
|
||||||
|
class QmlProfilerRunControl;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QMLPROFILER_EXPORT QmlProfilerTool : public QObject
|
class QMLPROFILER_EXPORT QmlProfilerTool : public QObject
|
||||||
@@ -48,8 +51,8 @@ public:
|
|||||||
explicit QmlProfilerTool(QObject *parent);
|
explicit QmlProfilerTool(QObject *parent);
|
||||||
~QmlProfilerTool();
|
~QmlProfilerTool();
|
||||||
|
|
||||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
Analyzer::AnalyzerRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
void finalizeRunControl(QmlProfilerRunControl *runControl);
|
||||||
|
|
||||||
QWidget *createWidgets();
|
QWidget *createWidgets();
|
||||||
bool prepareTool();
|
bool prepareTool();
|
||||||
|
|||||||
Reference in New Issue
Block a user