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
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
26
28public:
30 int detailType = -1,
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; }
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:
52
53 QString m_displayName;
54 QString m_data;
56 Message m_message;
57 RangeType m_rangeType;
58 int m_detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
59};
60
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
86
88
89#endif // QQMLPROFILEREVENTTYPE_P_H
[custom type definition]
\inmodule QtCore\reentrant
Definition qdatastream.h:46
friend QDataStream & operator<<(QDataStream &stream, const QQmlProfilerEventType &type)
QQmlProfilerEventType(Message message=MaximumMessage, RangeType rangeType=MaximumRangeType, int detailType=-1, const QQmlProfilerEventLocation &location=QQmlProfilerEventLocation(), const QString &data=QString(), const QString displayName=QString())
QQmlProfilerEventLocation location() const
void setDisplayName(const QString &displayName)
void setLocation(const QQmlProfilerEventLocation &location)
ProfileFeature feature() const
void setData(const QString &data)
friend QDataStream & operator>>(QDataStream &stream, QQmlProfilerEventType &type)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
EGLStreamKHR stream
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1525
GLint location
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint GLsizei const GLchar * message
QDataStream & operator<<(QDataStream &stream, const QQmlProfilerEventType &type)
bool operator!=(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
size_t qHash(const QQmlProfilerEventType &type)
bool operator==(const QQmlProfilerEventType &type1, const QQmlProfilerEventType &type2)
QDataStream & operator>>(QDataStream &stream, QQmlProfilerEventType &type)
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
unsigned int uint
Definition qtypes.h:34