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
qctfplugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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#define BUILD_LIBRARY
5#include <qstring.h>
6#include "qctfplugin_p.h"
7#include "qctflib_p.h"
8
10
12{
14 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QCtfLib" FILE "trace.json")
16
17public:
19 {
20
21 }
23 {
24 m_cleanup = true;
25 *m_shutdown = true;
27 }
28 void shutdown(bool *shutdown) override
29 {
30 m_shutdown = shutdown;
31 }
32 bool tracepointEnabled(const QCtfTracePointEvent &point) override
33 {
34 if (m_cleanup)
35 return false;
36 return QCtfLibImpl::instance()->tracepointEnabled(point);
37 }
38 void doTracepoint(const QCtfTracePointEvent &point, const QByteArray &arr) override
39 {
40 if (m_cleanup)
41 return;
42 QCtfLibImpl::instance()->doTracepoint(point, arr);
43 }
44 bool sessionEnabled() override
45 {
46 if (m_cleanup)
47 return false;
48 return QCtfLibImpl::instance()->sessionEnabled();
49 }
51 {
52 if (m_cleanup)
53 return nullptr;
54 return QCtfLibImpl::instance()->initializeTracepoint(point);
55 }
56private:
57 bool m_cleanup = false;
58 bool *m_shutdown = nullptr;
59};
60
62
63#include "qctfplugin.moc"
\inmodule QtCore
Definition qbytearray.h:57
static QCtfLib * instance()
Definition qctflib.cpp:59
static void cleanup()
Definition qctflib.cpp:66
void shutdown(bool *shutdown) override
QCtfTracePointPrivate * initializeTracepoint(const QCtfTracePointEvent &point) override
bool sessionEnabled() override
void doTracepoint(const QCtfTracePointEvent &point, const QByteArray &arr) override
bool tracepointEnabled(const QCtfTracePointEvent &point) override
Combined button and popup list for selecting options.
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
#define Q_INTERFACES(x)