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
4#ifndef QQMLPROFILEREVENTTYPE_P_H
5#define QQMLPROFILEREVENTTYPE_P_H
6
9
10#include <QtCore/qstring.h>
11#include <QtCore/qmetatype.h>
12#include <QtCore/qhash.h>
13
14//
15// W A R N I N G
16// -------------
17//
18// This file is not part of the Qt API. It exists purely as an
19// implementation detail. This header file may change from version to
20// version without notice, or even be removed.
21//
22// We mean it.
23//
24
25QT_BEGIN_NAMESPACE
26
27class QQmlProfilerEventType {
28public:
29 QQmlProfilerEventType(Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
30 int detailType = -1,
31 const QQmlProfilerEventLocation &location = QQmlProfilerEventLocation(),
32 const QString &data = QString(), const QString displayName = QString()) :
33 m_displayName(displayName), m_data(data), m_location(location), m_message(message),
34 m_rangeType(rangeType), m_detailType(detailType)
35 {}
36
37 void setDisplayName(const QString &displayName) { m_displayName = displayName; }
38 void setData(const QString &data) { m_data = data; }
39 void setLocation(const QQmlProfilerEventLocation &location) { m_location = location; }
40
41 ProfileFeature feature() const;
42 QString displayName() const { return m_displayName; }
43 QString data() const { return m_data; }
44 QQmlProfilerEventLocation location() const { return m_location; }
45 Message message() const { return m_message; }
46 RangeType rangeType() const { return m_rangeType; }
47 int detailType() const { return m_detailType; }
48
49private:
50 friend QDataStream &operator>>(QDataStream &stream, QQmlProfilerEventType &type);
51 friend QDataStream &operator<<(QDataStream &stream, const QQmlProfilerEventType &type);
52
53 QString m_displayName;
54 QString m_data;
55 QQmlProfilerEventLocation m_location;
56 Message m_message;
57 RangeType m_rangeType;
58 int m_detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
59};
60
61QDataStream &operator>>(QDataStream &stream, QQmlProfilerEventType &type);
62QDataStream &operator<<(QDataStream &stream, const QQmlProfilerEventType &type);
63
64inline size_t qHash(const QQmlProfilerEventType &type)
65{
66 return qHash(type.location())
67 ^ (((type.message() << 12) & 0xf000) // 4 bits message
68 | ((type.rangeType() << 24) & 0xf000000) // 4 bits rangeType
69 | ((static_cast<uint>(type.detailType()) << 28) & 0xf0000000)); // 4 bits detailType
70}
71
72inline bool operator==(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
73{
74 return type1.message() == type2.message() && type1.rangeType() == type2.rangeType()
75 && type1.detailType() == type2.detailType() && type1.location() == type2.location();
76}
77
78inline bool operator!=(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
79{
80 return !(type1 == type2);
81}
82
84
85QT_END_NAMESPACE
86
87Q_DECLARE_METATYPE(QQmlProfilerEventType)
88
89#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:801
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:812
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)
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:4006
QDataStream & operator>>(QDataStream &stream, QImage &image)
Definition qimage.cpp:4032