9#pragma qt_class(QtDebug)
12#include <QtCore/qcontainerfwd.h>
13#include <QtCore/qtextstream.h>
14#include <QtCore/qstring.h>
15#include <QtCore/qcontiguouscache.h>
16#include <QtCore/qsharedpointer.h>
27#if !defined(QT_LEAN_HEADERS) || QT_LEAN_HEADERS < 1
28# include <QtCore/qlist.h>
29# include <QtCore/qmap.h>
30# include <QtCore/qset.h>
31# include <QtCore/qvarlengtharray.h>
42 enum { VerbosityShift = 29, VerbosityMask = 0x7 };
60 bool noQuotes =
false;
61 bool message_output =
false;
62 int verbosity = DefaultVerbosity;
66 enum Latin1Content { ContainsBinary = 0, ContainsLatin1 };
68 QT7_ONLY(Q_CORE_EXPORT)
void putUcs4(
uint ucs4);
70 QT7_ONLY(Q_CORE_EXPORT)
void putByteArray(
const char *
begin,
size_t length, Latin1Content content);
79 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(
QDebug)
83 QT7_ONLY(Q_CORE_EXPORT)
QDebug &resetFormat();
86 inline QDebug &nospace() {
stream->space =
false;
return *
this; }
88 inline QDebug &verbosity(
int verbosityLevel) {
stream->verbosity = verbosityLevel;
return *
this; }
89 int verbosity()
const {
return stream->verbosity; }
90 void setVerbosity(
int verbosityLevel) {
stream->verbosity = verbosityLevel; }
91 enum VerbosityLevel { MinimumVerbosity = 0, DefaultVerbosity = 2, MaximumVerbosity = 7 };
93 bool autoInsertSpaces()
const {
return stream->space; }
94 void setAutoInsertSpaces(
bool b) {
stream->space =
b; }
96 [[nodiscard]]
bool quoteStrings() const noexcept {
return !
stream->noQuotes; }
97 void setQuoteStrings(
bool b) {
stream->noQuotes = !
b; }
100 inline QDebug &noquote() {
stream->noQuotes =
true;
return *
this; }
101 inline QDebug &maybeQuote(
char c =
'"') {
if (!
stream->noQuotes)
stream->ts <<
c;
return *
this; }
135 {
stream->ts <<
m;
return *
this; }
138 template <
typename Char,
typename...Args>
141 template <
typename Char,
typename...Args>
144 template <
typename...Args>
148 template <
typename...Args>
153 template <
typename...Args>
157 template <
typename...Args>
162 template <
typename...Args>
166 template <
typename...Args>
170 template <
typename...Args>
173 if constexpr (
sizeof(wchar_t) == 2)
179 template <
typename...Args>
182 if constexpr (
sizeof(wchar_t) == 2)
188 template <
typename...Args>
192 template <
typename...Args>
197 template <
typename Rep,
typename Period>
200 stream->ts << duration.count();
201 putTimeUnit(Period::num, Period::den);
205 template <
typename T>
210 stream.nospace() << std::forward<T>(
object);
235 inline QNoDebug &space() {
return *
this; }
236 inline QNoDebug &nospace() {
return *
this; }
237 inline QNoDebug &maybeSpace() {
return *
this; }
238 inline QNoDebug &
quote() {
return *
this; }
239 inline QNoDebug &noquote() {
return *
this; }
240 inline QNoDebug &maybeQuote(
const char =
'"') {
return *
this; }
241 inline QNoDebug &verbosity(
int) {
return *
this; }
244 inline QNoDebug &
operator<<(
const T &) {
return *
this; }
255template <
typename SequentialContainer>
259 debug.nospace() << which <<
'(';
260 typename SequentialContainer::const_iterator
it =
c.
begin(),
end =
c.end();
273template <
typename AssociativeContainer>
277 debug.nospace() << which <<
"(";
278 for (
typename AssociativeContainer::const_iterator
it =
c.
constBegin();
280 debug <<
'(' <<
it.key() <<
", " <<
it.value() <<
')';
288template<
typename ...T>
290 std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator<QDebug, T>...>,
QDebug>;
292template<
typename Container,
typename ...T>
294 std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator_container<QDebug, Container, T>...>,
QDebug>;
304template<
typename T, qsizetype P>
310template <
typename T,
typename Alloc>
316template <
typename T,
typename Alloc>
328template <
typename Key,
typename T,
typename Compare,
typename Alloc>
334template <
typename Key,
typename T,
typename Compare,
typename Alloc>
340template <
class Key,
class T>
346template <
class Key,
class T>
352template <
class Key,
class T>
358template <
class Key,
class T>
364template <
class T1,
class T2>
368 debug.nospace() <<
"std::pair(" << pair.first <<
',' << pair.second <<
')';
382 debug.nospace() <<
"QContiguousCache(";
385 if (
i !=
cache.lastIndex())
396template <
class T, qsizetype P>
399template <
typename T,
typename Alloc>
402template <
typename T,
typename Alloc>
405template <
typename Key,
typename T,
typename Compare,
typename Alloc>
408template <
typename Key,
typename T,
typename Compare,
typename Alloc>
411template <
class Key,
class T>
414template <
class Key,
class T>
417template <
class Key,
class T>
420template <
class Key,
class T>
426template <
class T1,
class T2>
429template <
class T1,
class T2>
441 debug.nospace() <<
"QSharedPointer(" <<
ptr.data() <<
")";
447template <
typename T,
typename Tag>
451 debug.nospace() <<
"QTaggedPointer(" <<
ptr.pointer() <<
", " <<
ptr.tag() <<
")";
457template <
typename Int>
463 bool needSeparator =
false;
464 for (
size_t i = 0;
i < sizeofT * 8; ++
i) {
469 needSeparator =
true;
476#if !defined(QT_NO_QOBJECT) && !defined(Q_QDOC)
481typename std::enable_if<QtPrivate::IsQEnumHelper<T>::Value,
QDebug>
::type
485 const char *
name = qt_getEnumName(
value);
490 typename A =
typename std::enable_if<std::is_enum<T>::value,
void>
::type,
491 typename B =
typename std::enable_if<
sizeof(T) <=
sizeof(
int),
void>
::type,
492 typename C =
typename std::enable_if<!QtPrivate::IsQEnumHelper<T>::Value,
void>
::type,
493 typename D =
typename std::enable_if<QtPrivate::IsQEnumHelper<QFlags<T>>::Value,
void>
::type>
498 const char *
name = qt_getEnumName(FlagsT());
503inline typename std::enable_if<
509 const char *
name = qt_getEnumName(T());
514inline typename std::enable_if<
532 return qt_QMetaEnum_flagDebugOperator_helper(
debug,
flags);
538 debug.nospace() <<
"QKeyCombination("
552#define QT_FOR_EACH_CORE_FOUNDATION_TYPE(F) \
563#define QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(F) \
567#define QT_FOR_EACH_CORE_GRAPHICS_TYPE(F) \
570#define QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(F) \
576#define QT_FORWARD_DECLARE_CF_TYPE(type) Q_FORWARD_DECLARE_CF_TYPE(type);
577#define QT_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type);
578#define QT_FORWARD_DECLARE_CG_TYPE(type) Q_FORWARD_DECLARE_CG_TYPE(type);
579#define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type);
591#define QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE(CFType) \
592 Q_CORE_EXPORT QDebug operator<<(QDebug, CFType##Ref);
594#define Q_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE(CFType) \
595 QDebug operator<<(QDebug debug, CFType##Ref ref) \
598 return debug << QT_STRINGIFY(CFType) "Ref(0x0)"; \
599 if (CFStringRef description = CFCopyDescription(ref)) { \
600 QDebugStateSaver saver(debug); \
601 debug.noquote() << description; \
602 CFRelease(description); \
620#undef QT_FORWARD_DECLARE_CF_TYPE
621#undef QT_FORWARD_DECLARE_MUTABLE_CF_TYPE
622#undef QT_FORWARD_DECLARE_CG_TYPE
623#undef QT_FORWARD_DECLARE_MUTABLE_CG_TYPE
IOBluetoothDevice * device
std::conditional< std::is_unsigned< typenamestd::underlying_type< Enum >::type >::value, unsignedint, signedint >::type Int
\inheaderfile QIODevice \inmodule QtCore
\inmodule QtCore \reentrant
constexpr Qt::Key key() const noexcept
constexpr Qt::KeyboardModifiers keyboardModifiers() const noexcept
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUcs4(const char32_t *, qsizetype size=-1)
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QDebug printAssociativeContainer(QDebug debug, const char *which, const AssociativeContainer &c)
QDebug printSequentialContainer(QDebug debug, const char *which, const SequentialContainer &c)
char qt_getEnumMetaObject(const T &)
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & showbase(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ShowBase) on stream and r...
std::pair< T1, T2 > QPair
QT_FOR_EACH_CORE_GRAPHICS_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TYPE)
QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TYPE)
QT_FOR_EACH_CORE_FOUNDATION_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TYPE)
QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TYPE)
#define Q_FORWARD_DECLARE_CF_TYPE(type)
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, qint64 value, const QMetaObject *meta, const char *name)
void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value)
std::enable_if_t< std::conjunction_v< QTypeTraits::has_ostream_operator_container< QDebug, Container, T >... >, QDebug > QDebugIfHasDebugStreamContainer
std::enable_if_t< std::conjunction_v< QTypeTraits::has_ostream_operator< QDebug, T >... >, QDebug > QDebugIfHasDebugStream
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static ControlElement< T > * ptr(QWidget *widget)
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei length
GLsizei const GLchar *const * string
[0]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QBasicUtf8StringView< false > QUtf8StringView
constexpr void qt_ptr_swap(T *&lhs, T *&rhs) noexcept
QTextStream &(* QTextStreamFunction)(QTextStream &)
unsigned long long quint64
static QString quote(const QString &str)
QFuture< QSet< QChar > > set
[10]
char * toString(const MyType &t)
[31]