Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlprofiler.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qqmlprofiler_p.h"
6
8
9QQmlProfiler::QQmlProfiler() : featuresEnabled(0)
10{
11 static int metatype = qRegisterMetaType<QVector<QQmlProfilerData> >();
12 static int metatype2 = qRegisterMetaType<QQmlProfiler::LocationHash> ();
13 Q_UNUSED(metatype);
14 Q_UNUSED(metatype2);
15 m_timer.start();
16}
17
18void QQmlProfiler::startProfiling(quint64 features)
19{
20 featuresEnabled = features;
21}
22
23void QQmlProfiler::stopProfiling()
24{
25 featuresEnabled = false;
26 reportData();
27 m_locations.clear();
28}
29
30void QQmlProfiler::reportData()
31{
32 LocationHash resolved;
33 resolved.reserve(m_locations.size());
34 for (auto it = m_locations.begin(), end = m_locations.end(); it != end; ++it) {
35 if (!it->sent) {
36 resolved.insert(it.key(), it.value());
37 it->sent = true;
38 }
39 }
40
41 QVector<QQmlProfilerData> data;
43 emit dataReady(data, resolved);
44}
45
47
48#include "moc_qqmlprofiler_p.cpp"
NSData * m_data
void swap(QSet< T > &other) noexcept
Definition qset.h:36
iterator begin()
Definition qset.h:136
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLuint GLuint end
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define emit
#define Q_UNUSED(x)
unsigned long long quint64
Definition qtypes.h:61