diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-07-20 15:35:50 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-07-28 09:17:49 +0000 |
commit | bd48f0e5edb1d5ce10529360fb9d14e7b7135022 (patch) | |
tree | 8fd715131155292216389845ffe78ec9fbd43b69 /tools/qmlprofiler | |
parent | b096d9e4e7187a1965bd15d1c5a55f228ec3ae00 (diff) |
Tooling: Convert connects to Qt5 style
Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools/qmlprofiler')
-rw-r--r-- | tools/qmlprofiler/commandlistener.h | 2 | ||||
-rw-r--r-- | tools/qmlprofiler/main.cpp | 6 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 28 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 11 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerdata.h | 11 |
5 files changed, 30 insertions, 28 deletions
diff --git a/tools/qmlprofiler/commandlistener.h b/tools/qmlprofiler/commandlistener.h index c10b199daa..2a994bf449 100644 --- a/tools/qmlprofiler/commandlistener.h +++ b/tools/qmlprofiler/commandlistener.h @@ -33,7 +33,7 @@ class CommandListener : public QObject { Q_OBJECT -public slots: +public: void readCommand(); signals: diff --git a/tools/qmlprofiler/main.cpp b/tools/qmlprofiler/main.cpp index d3e2beb83f..c7cb979ff8 100644 --- a/tools/qmlprofiler/main.cpp +++ b/tools/qmlprofiler/main.cpp @@ -39,8 +39,10 @@ int main(int argc, char *argv[]) QThread listenerThread; CommandListener listener; listener.moveToThread(&listenerThread); - QObject::connect(&listener, SIGNAL(command(QString)), &app, SLOT(userCommand(QString))); - QObject::connect(&app, SIGNAL(readyForCommand()), &listener, SLOT(readCommand())); + QObject::connect(&listener, &CommandListener::command, + &app, &QmlProfilerApplication::userCommand); + QObject::connect(&app, &QmlProfilerApplication::readyForCommand, + &listener, &CommandListener::readCommand); listenerThread.start(); int exitValue = app.exec(); listenerThread.quit(); diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index b04ff7e558..063e5e2961 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(); } @@ -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); diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 04f9d43c87..13f0f041f0 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -58,16 +58,14 @@ public: void parseArguments(); int exec(); bool isInteractive() const; - -signals: - void readyForCommand(); - -public slots: void userCommand(const QString &command); void notifyTraceStarted(); void outputData(); -private slots: +signals: + void readyForCommand(); + +private: void run(); void tryToConnect(); void connected(); @@ -81,7 +79,6 @@ private slots: void logError(const QString &error); void logStatus(const QString &status); -private: quint64 parseFeatures(const QStringList &featureList, const QString &values, bool exclude); bool checkOutputFile(PendingRequest pending); void flush(); diff --git a/tools/qmlprofiler/qmlprofilerdata.h b/tools/qmlprofiler/qmlprofilerdata.h index 2570513d93..00ef037071 100644 --- a/tools/qmlprofiler/qmlprofilerdata.h +++ b/tools/qmlprofiler/qmlprofilerdata.h @@ -58,12 +58,6 @@ public: bool isEmpty() const; -signals: - void error(QString); - void stateChanged(); - void dataReady(); - -public slots: void clear(); void setTraceEndTime(qint64 time); void setTraceStartTime(qint64 time); @@ -83,6 +77,11 @@ public slots: void complete(); bool save(const QString &filename); +signals: + void error(QString); + void stateChanged(); + void dataReady(); + private: void sortStartTimes(); void computeQmlTime(); |