Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlprofilereventtype_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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// Qt-Security score:significant
4
5#ifndef QQMLPROFILEREVENTTYPE_P_H
6#define QQMLPROFILEREVENTTYPE_P_H
7
10
11#include <QtCore/qstring.h>
12#include <QtCore/qmetatype.h>
13#include <QtCore/qhash.h>
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the Qt API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
26QT_BEGIN_NAMESPACE
27
28class QQmlProfilerEventType {
29public:
30 QQmlProfilerEventType(Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
31 int detailType = -1,
32 const QQmlProfilerEventLocation &location = QQmlProfilerEventLocation(),
33 const QString &data = QString(), const QString displayName = QString()) :
34 m_displayName(displayName), m_data(data), m_location(location), m_message(message),
35 m_rangeType(rangeType), m_detailType(detailType)
36 {}
37
38 void setDisplayName(const QString &displayName) { m_displayName = displayName; }
39 void setData(const QString &data) { m_data = data; }
40 void setLocation(const QQmlProfilerEventLocation &location) { m_location = location; }
41
42 ProfileFeature feature() const;
43 QString displayName() const { return m_displayName; }
44 QString data() const { return m_data; }
45 QQmlProfilerEventLocation location() const { return m_location; }
46 Message message() const { return m_message; }
47 RangeType rangeType() const { return m_rangeType; }
48 int detailType() const { return m_detailType; }
49
50private:
51 friend QDataStream &operator>>(QDataStream &stream, QQmlProfilerEventType &type);
52 friend QDataStream &operator<<(QDataStream &stream, const QQmlProfilerEventType &type);
53
54 QString m_displayName;
55 QString m_data;
56 QQmlProfilerEventLocation m_location;
57 Message m_message;
58 RangeType m_rangeType;
59 int m_detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
60};
61
62QDataStream &operator>>(QDataStream &stream, QQmlProfilerEventType &type);
63QDataStream &operator<<(QDataStream &stream, const QQmlProfilerEventType &type);
64
65inline size_t qHash(const QQmlProfilerEventType &type)
66{
67 return qHash(type.location())
68 ^ (((type.message() << 12) & 0xf000) // 4 bits message
69 | ((type.rangeType() << 24) & 0xf000000) // 4 bits rangeType
70 | ((static_cast<uint>(type.detailType()) << 28) & 0xf0000000)); // 4 bits detailType
71}
72
73inline bool operator==(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
74{
75 return type1.message() == type2.message() && type1.rangeType() == type2.rangeType()
76 && type1.detailType() == type2.detailType() && type1.location() == type2.location();
77}
78
79inline bool operator!=(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
80{
81 return !(type1 == type2);
82}
83
85
86QT_END_NAMESPACE
87
88Q_DECLARE_METATYPE(QQmlProfilerEventType)
89
90#endif // QQMLPROFILEREVENTTYPE_P_H
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
Definition qbytearray.h:807
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
Definition qbytearray.h:818
void setFlushInterval(quint32 flushInterval)
quint64 recordedFeatures() const
void traceFinished(qint64 timestamp, const QList< int > &engineIds)
void setRequestedFeatures(quint64 features)
void recordedFeaturesChanged(quint64 features)
void traceStarted(qint64 timestamp, const QList< int > &engineIds)
virtual void messageReceived(const QByteArray &) override
void recordingChanged(bool arg)
QQmlProfilerClient(QQmlProfilerClientPrivate &dd)
void onStateChanged(State status)
void sendRecordingStatus(int engineId=-1)
Combined button and popup list for selecting options.
size_t qHash(const QHashedString &string)
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
QDataStream & operator<<(QDataStream &stream, const QQmlProfilerEvent &event)
QDataStream & operator>>(QDataStream &stream, QQmlProfilerEvent &event)
Q_DECLARE_TYPEINFO(QQmlProfilerEvent, Q_RELOCATABLE_TYPE)
bool operator==(const QQmlProfilerEvent &event1, const QQmlProfilerEvent &event2)
bool operator!=(const QQmlProfilerEvent &event1, const QQmlProfilerEvent &event2)
QDataStream & operator<<(QDataStream &stream, const QQmlProfilerEventLocation &location)
size_t qHash(const QQmlProfilerEventLocation &location)
Q_DECLARE_TYPEINFO(QQmlProfilerEventLocation, Q_RELOCATABLE_TYPE)
bool operator!=(const QQmlProfilerEventLocation &location1, const QQmlProfilerEventLocation &location2)
bool operator==(const QQmlProfilerEventLocation &location1, const QQmlProfilerEventLocation &location2)
QDataStream & operator>>(QDataStream &stream, QQmlProfilerEventLocation &location)
EventType
Definition qwasmevent.h:24
QDataStream & operator<<(QDataStream &stream, const QImage &image)
[0]
Definition qimage.cpp:4009
QDataStream & operator>>(QDataStream &stream, QImage &image)
Definition qimage.cpp:4035