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
qqmljsloggingutils_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QQMLJSLOGGINGUTILS_P_H
5#define QQMLJSLOGGINGUTILS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qstring.h>
19#include <qtqmlcompilerexports.h>
20
21#include "qqmljsloggingutils.h"
22
24
25namespace QQmlJS {
26
28
30
31class Q_QMLCOMPILER_EXPORT LoggerCategory
32{
33 Q_DECLARE_PRIVATE(LoggerCategory)
34
35public:
37 LoggerCategory(QString name, QString settingsName, QString description, QtMsgType level,
38 bool ignored = false, bool isDefault = false);
41 LoggerCategory &operator=(const LoggerCategory &);
42 LoggerCategory &operator=(LoggerCategory &&) noexcept;
44
45 QString name() const;
46 QString settingsName() const;
47 QString description() const;
48 QtMsgType level() const;
49 bool isIgnored() const;
50 bool isDefault() const;
51
52 LoggerWarningId id() const;
53
54 void setLevel(QtMsgType);
55 void setIgnored(bool);
56
58 std::unique_ptr<QQmlJS::LoggerCategoryPrivate> d_ptr;
59};
60
62{
63 friend class QT_PREPEND_NAMESPACE(QQmlJS::LoggerCategory);
64
65public:
66 LoggerWarningId id() const { return LoggerWarningId(m_name); }
67
68 void setLevel(QtMsgType);
69 void setIgnored(bool);
70
71 QString name() const;
75 bool isIgnored() const;
76 bool isDefault() const;
77 bool hasChanged() const;
78
80
81 friend bool operator==(const LoggerCategoryPrivate &lhs, const LoggerCategoryPrivate &rhs)
82 {
83 return operatorEqualsImpl(lhs, rhs);
84 }
85 friend bool operator!=(const LoggerCategoryPrivate &lhs, const LoggerCategoryPrivate &rhs)
86 {
87 return !operatorEqualsImpl(lhs, rhs);
88 }
89
90 bool operator==(const LoggerWarningId warningId) const { return warningId.name() == m_name; }
91
92private:
93 static bool operatorEqualsImpl(const LoggerCategoryPrivate &, const LoggerCategoryPrivate &);
94
95 QString m_name;
96 QString m_settingsName;
97 QString m_description;
98 QtMsgType m_level = QtDebugMsg;
99 bool m_ignored = false;
100 bool m_isDefault = false; // Whether or not the category can be disabled
101 bool m_changed = false;
102};
103
104} // namespace QQmlJS
105
107
108#endif // QQMLJSLOGGINGUTILS_P_H
friend bool operator!=(const LoggerCategoryPrivate &lhs, const LoggerCategoryPrivate &rhs)
bool operator==(const LoggerWarningId warningId) const
friend bool operator==(const LoggerCategoryPrivate &lhs, const LoggerCategoryPrivate &rhs)
LoggerCategory(LoggerCategory &&) noexcept
\inmodule QtQmlCompiler
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
QtMsgType
Definition qlogging.h:29
@ QtDebugMsg
Definition qlogging.h:30
GLenum GLuint GLint level
GLenum GLuint id
[7]
GLuint name