aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-20 18:15:05 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-29 14:36:20 +0000
commit7784327e71f4d4f727e2d59733fa68122a85997a (patch)
tree68b0119a100f56e6a39aa682eeb0b6921354a773
parentc81ff41a16af05f8500bec383d09f83755addde7 (diff)
Use QVector rather than QList for storing QQmlProfilerData
Change-Id: I94519181e915c5e2df9614ad4e1180fb159252e3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--src/qml/debugger/qqmlprofiler.cpp10
-rw-r--r--src/qml/debugger/qqmlprofiler_p.h8
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp12
3 files changed, 15 insertions, 15 deletions
diff --git a/src/qml/debugger/qqmlprofiler.cpp b/src/qml/debugger/qqmlprofiler.cpp
index b35da8a714..6c656f20e0 100644
--- a/src/qml/debugger/qqmlprofiler.cpp
+++ b/src/qml/debugger/qqmlprofiler.cpp
@@ -91,8 +91,8 @@ QQmlProfilerAdapter::QQmlProfilerAdapter(QQmlProfilerService *service, QQmlEngin
connect(this, SIGNAL(dataRequested()), engine->profiler, SLOT(reportData()));
connect(this, SIGNAL(referenceTimeKnown(QElapsedTimer)),
engine->profiler, SLOT(setTimer(QElapsedTimer)));
- connect(engine->profiler, SIGNAL(dataReady(QList<QQmlProfilerData>)),
- this, SLOT(receiveData(QList<QQmlProfilerData>)));
+ connect(engine->profiler, SIGNAL(dataReady(QVector<QQmlProfilerData>)),
+ this, SLOT(receiveData(QVector<QQmlProfilerData>)));
}
qint64 QQmlProfilerAdapter::sendMessages(qint64 until, QList<QByteArray> &messages)
@@ -104,7 +104,7 @@ qint64 QQmlProfilerAdapter::sendMessages(qint64 until, QList<QByteArray> &messag
return data.empty() ? -1 : data.front().time;
}
-void QQmlProfilerAdapter::receiveData(const QList<QQmlProfilerData> &new_data)
+void QQmlProfilerAdapter::receiveData(const QVector<QQmlProfilerData> &new_data)
{
data = new_data;
service->dataReady(this);
@@ -113,7 +113,7 @@ void QQmlProfilerAdapter::receiveData(const QList<QQmlProfilerData> &new_data)
QQmlProfiler::QQmlProfiler() : featuresEnabled(0)
{
- static int metatype = qRegisterMetaType<QList<QQmlProfilerData> >();
+ static int metatype = qRegisterMetaType<QVector<QQmlProfilerData> >();
Q_UNUSED(metatype);
m_timer.start();
}
@@ -132,7 +132,7 @@ void QQmlProfiler::stopProfiling()
void QQmlProfiler::reportData()
{
- QList<QQmlProfilerData> result;
+ QVector<QQmlProfilerData> result;
result.reserve(m_data.size());
for (int i = 0; i < m_data.size(); ++i)
result.append(m_data[i]);
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h
index 5c994b112f..71efa69490 100644
--- a/src/qml/debugger/qqmlprofiler_p.h
+++ b/src/qml/debugger/qqmlprofiler_p.h
@@ -171,7 +171,7 @@ public slots:
void setTimer(const QElapsedTimer &timer) { m_timer = timer; }
signals:
- void dataReady(const QList<QQmlProfilerData> &);
+ void dataReady(const QVector<QQmlProfilerData> &);
protected:
QElapsedTimer m_timer;
@@ -185,10 +185,10 @@ public:
qint64 sendMessages(qint64 until, QList<QByteArray> &messages);
public slots:
- void receiveData(const QList<QQmlProfilerData> &new_data);
+ void receiveData(const QVector<QQmlProfilerData> &new_data);
private:
- QList<QQmlProfilerData> data;
+ QVector<QQmlProfilerData> data;
};
//
@@ -332,6 +332,6 @@ private:
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QList<QQmlProfilerData>)
+Q_DECLARE_METATYPE(QVector<QQmlProfilerData>)
#endif // QQMLPROFILER_P_H
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 8a83c25c19..f9f05964a7 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -139,11 +139,11 @@ public:
{
}
- QList<QQmlProfilerData> qmlMessages;
- QList<QQmlProfilerData> javascriptMessages;
- QList<QQmlProfilerData> jsHeapMessages;
- QList<QQmlProfilerData> asynchronousMessages;
- QList<QQmlProfilerData> pixmapMessages;
+ QVector<QQmlProfilerData> qmlMessages;
+ QVector<QQmlProfilerData> javascriptMessages;
+ QVector<QQmlProfilerData> jsHeapMessages;
+ QVector<QQmlProfilerData> asynchronousMessages;
+ QVector<QQmlProfilerData> pixmapMessages;
void setTraceState(bool enabled) {
QByteArray message;
@@ -449,7 +449,7 @@ bool tst_QQmlProfilerService::verify(tst_QQmlProfilerService::MessageListType ty
int expectedPosition, const QQmlProfilerData &expected,
quint32 checks)
{
- QList<QQmlProfilerData> *target = 0;
+ QVector<QQmlProfilerData> *target = 0;
switch (type) {
case MessageListQML: target = &(m_client->qmlMessages); break;
case MessageListJavaScript: target = &(m_client->javascriptMessages); break;