diff options
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerapplication.cpp')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index b04ff7e558..033492b516 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -87,17 +87,21 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) : m_connectionAttempts(0) { m_connectTimer.setInterval(1000); - connect(&m_connectTimer, SIGNAL(timeout()), this, SLOT(tryToConnect())); + connect(&m_connectTimer, &QTimer::timeout, this, &QmlProfilerApplication::tryToConnect); - connect(&m_connection, SIGNAL(connected()), this, SLOT(connected())); + connect(&m_connection, &QQmlDebugConnection::connected, + this, &QmlProfilerApplication::connected); - connect(&m_qmlProfilerClient, SIGNAL(enabledChanged(bool)), - this, SLOT(traceClientEnabledChanged(bool))); - connect(&m_qmlProfilerClient, SIGNAL(recordingStarted()), this, SLOT(notifyTraceStarted())); - connect(&m_qmlProfilerClient, SIGNAL(error(QString)), this, SLOT(logError(QString))); + connect(&m_qmlProfilerClient, &QmlProfilerClient::enabledChanged, + this, &QmlProfilerApplication::traceClientEnabledChanged); + connect(&m_qmlProfilerClient, &QmlProfilerClient::recordingStarted, + this, &QmlProfilerApplication::notifyTraceStarted); + connect(&m_qmlProfilerClient, &QmlProfilerClient::error, + this, &QmlProfilerApplication::logError); - connect(&m_profilerData, SIGNAL(error(QString)), this, SLOT(logError(QString))); - connect(&m_profilerData, SIGNAL(dataReady()), this, SLOT(traceFinished())); + connect(&m_profilerData, &QmlProfilerData::error, this, &QmlProfilerApplication::logError); + connect(&m_profilerData, &QmlProfilerData::dataReady, + this, &QmlProfilerApplication::traceFinished); } @@ -257,7 +261,7 @@ void QmlProfilerApplication::parseArguments() int QmlProfilerApplication::exec() { - QTimer::singleShot(0, this, SLOT(run())); + QTimer::singleShot(0, this, &QmlProfilerApplication::run); return QCoreApplication::exec(); } @@ -270,8 +274,8 @@ quint64 QmlProfilerApplication::parseFeatures(const QStringList &featureList, co bool exclude) { quint64 features = exclude ? std::numeric_limits<quint64>::max() : 0; - QStringList givenFeatures = values.split(QLatin1Char(',')); - foreach (const QString &f, givenFeatures) { + const QStringList givenFeatures = values.split(QLatin1Char(',')); + for (const QString &f : givenFeatures) { int index = featureList.indexOf(f); if (index < 0) { logError(tr("Unknown feature '%1'").arg(f)); @@ -343,7 +347,7 @@ bool QmlProfilerApplication::checkOutputFile(PendingRequest pending) void QmlProfilerApplication::userCommand(const QString &command) { - QStringList args = command.split(QChar::Space, QString::SkipEmptyParts); + auto args = command.splitRef(QChar::Space, QString::SkipEmptyParts); if (args.isEmpty()) { prompt(); return; @@ -397,7 +401,7 @@ void QmlProfilerApplication::userCommand(const QString &command) } else if (m_profilerData.isEmpty()) { prompt(tr("No data was recorded so far.")); } else { - m_interactiveOutputFile = args.length() > 0 ? args[0] : m_outputFile; + m_interactiveOutputFile = args.length() > 0 ? args.at(0).toString() : m_outputFile; if (checkOutputFile(REQUEST_OUTPUT_FILE)) output(); } @@ -414,7 +418,7 @@ void QmlProfilerApplication::userCommand(const QString &command) if (!m_recording && m_profilerData.isEmpty()) { prompt(tr("No data was recorded so far.")); } else { - m_interactiveOutputFile = args.length() > 0 ? args[0] : m_outputFile; + m_interactiveOutputFile = args.length() > 0 ? args.at(0).toString() : m_outputFile; if (checkOutputFile(REQUEST_FLUSH_FILE)) flush(); } @@ -460,9 +464,9 @@ void QmlProfilerApplication::run() arguments << m_programArguments; m_process->setProcessChannelMode(QProcess::MergedChannels); - connect(m_process, SIGNAL(readyRead()), this, SLOT(processHasOutput())); - connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, - SLOT(processFinished())); + connect(m_process, &QIODevice::readyRead, this, &QmlProfilerApplication::processHasOutput); + connect(m_process, static_cast<void(QProcess::*)(int)>(&QProcess::finished), + this, [this](int){ processFinished(); }); logStatus(QString("Starting '%1 %2' ...").arg(m_programPath, arguments.join(QLatin1Char(' ')))); m_process->start(m_programPath, arguments); |