QtBase  v6.3.1
qdebug.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Copyright (C) 2016 Intel Corporation.
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of the QtCore module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU Lesser General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 3 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
22 ** packaging of this file. Please review the following information to
23 ** ensure the GNU Lesser General Public License version 3 requirements
24 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
25 **
26 ** GNU General Public License Usage
27 ** Alternatively, this file may be used under the terms of the GNU
28 ** General Public License version 2.0 or (at your option) the GNU General
29 ** Public license version 3 or any later version approved by the KDE Free
30 ** Qt Foundation. The licenses are as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
32 ** included in the packaging of this file. Please review the following
33 ** information to ensure the GNU General Public License requirements will
34 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
35 ** https://www.gnu.org/licenses/gpl-3.0.html.
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 #ifndef QDEBUG_H
42 #define QDEBUG_H
43 
44 #include <QtCore/qalgorithms.h>
45 #include <QtCore/qhash.h>
46 #include <QtCore/qlist.h>
47 #include <QtCore/qmap.h>
48 #include <QtCore/qtextstream.h>
49 #include <QtCore/qstring.h>
50 #include <QtCore/qset.h>
51 #include <QtCore/qvarlengtharray.h>
52 #include <QtCore/qcontiguouscache.h>
53 #include <QtCore/qsharedpointer.h>
54 
55 // all these have already been included by various headers above, but don't rely on indirect includes:
56 #include <vector>
57 #include <list>
58 #include <map>
59 #include <utility>
60 
62 
63 
64 class Q_CORE_EXPORT QDebug : public QIODeviceBase
65 {
66  friend class QMessageLogger;
67  friend class QDebugStateSaver;
69  struct Stream {
70  enum { VerbosityShift = 29, VerbosityMask = 0x7 };
71 
72  Stream(QIODevice *device)
73  : ts(device)
74  {}
75  Stream(QString *string)
76  : ts(string, WriteOnly)
77  {}
78  Stream(QtMsgType t)
79  : ts(&buffer, WriteOnly),
80  type(t),
81  message_output(true)
82  {}
83  QTextStream ts;
85  int ref = 1;
87  bool space = true;
88  bool noQuotes = false;
89  bool message_output = false;
90  int verbosity = DefaultVerbosity;
92  } *stream;
93 
94  enum Latin1Content { ContainsBinary = 0, ContainsLatin1 };
95 
96  void putUcs4(uint ucs4);
97  void putString(const QChar *begin, size_t length);
98  void putByteArray(const char *begin, size_t length, Latin1Content content);
99 public:
100  explicit QDebug(QIODevice *device) : stream(new Stream(device)) {}
101  explicit QDebug(QString *string) : stream(new Stream(string)) {}
102  explicit QDebug(QtMsgType t) : stream(new Stream(t)) {}
103  QDebug(const QDebug &o) : stream(o.stream) { ++stream->ref; }
104  QDebug(QDebug &&other) noexcept : stream{qExchange(other.stream, nullptr)} {}
105  inline QDebug &operator=(const QDebug &other);
107  ~QDebug();
108  void swap(QDebug &other) noexcept { qt_ptr_swap(stream, other.stream); }
109 
110  QDebug &resetFormat();
111 
112  inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
113  inline QDebug &nospace() { stream->space = false; return *this; }
114  inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
115  inline QDebug &verbosity(int verbosityLevel) { stream->verbosity = verbosityLevel; return *this; }
116  int verbosity() const { return stream->verbosity; }
117  void setVerbosity(int verbosityLevel) { stream->verbosity = verbosityLevel; }
118  enum VerbosityLevel { MinimumVerbosity = 0, DefaultVerbosity = 2, MaximumVerbosity = 7 };
119 
120  bool autoInsertSpaces() const { return stream->space; }
121  void setAutoInsertSpaces(bool b) { stream->space = b; }
122 
123  inline QDebug &quote() { stream->noQuotes = false; return *this; }
124  inline QDebug &noquote() { stream->noQuotes = true; return *this; }
125  inline QDebug &maybeQuote(char c = '"') { if (!stream->noQuotes) stream->ts << c; return *this; }
126 
127  inline QDebug &operator<<(QChar t) { putUcs4(t.unicode()); return maybeSpace(); }
128  inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
129  inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
130  inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
131  inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
132  inline QDebug &operator<<(char16_t t) { return *this << QChar(ushort(t)); }
133  inline QDebug &operator<<(char32_t t) { putUcs4(t); return maybeSpace(); }
134  inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }
135  inline QDebug &operator<<(unsigned int t) { stream->ts << t; return maybeSpace(); }
136  inline QDebug &operator<<(signed long t) { stream->ts << t; return maybeSpace(); }
137  inline QDebug &operator<<(unsigned long t) { stream->ts << t; return maybeSpace(); }
138  inline QDebug &operator<<(qint64 t) { stream->ts << t; return maybeSpace(); }
139  inline QDebug &operator<<(quint64 t) { stream->ts << t; return maybeSpace(); }
140  inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
141  inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
142  inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); }
143  inline QDebug &operator<<(const char16_t *t) { stream->ts << QStringView(t); return maybeSpace(); }
144 #if QT_STRINGVIEW_LEVEL < 2
145  inline QDebug &operator<<(const QString & t) { putString(t.constData(), uint(t.length())); return maybeSpace(); }
146 #endif
147  inline QDebug &operator<<(QStringView s) { putString(s.data(), size_t(s.size())); return maybeSpace(); }
148  inline QDebug &operator<<(QUtf8StringView s) { putByteArray(reinterpret_cast<const char*>(s.data()), s.size(), ContainsBinary); return maybeSpace(); }
149  inline QDebug &operator<<(QLatin1String t) { putByteArray(t.latin1(), t.size(), ContainsLatin1); return maybeSpace(); }
150  inline QDebug &operator<<(const QByteArray & t) { putByteArray(t.constData(), t.size(), ContainsBinary); return maybeSpace(); }
151  inline QDebug &operator<<(QByteArrayView t) { putByteArray(t.constData(), t.size(), ContainsBinary); return maybeSpace(); }
152  inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
153  inline QDebug &operator<<(std::nullptr_t) { stream->ts << "(nullptr)"; return maybeSpace(); }
155  stream->ts << f;
156  return *this;
157  }
158 
160  { stream->ts << m; return *this; }
161 
162  template <typename T>
163  static QString toString(T &&object)
164  {
165  QString buffer;
166  QDebug stream(&buffer);
167  stream.nospace() << std::forward<T>(object);
168  return buffer;
169  }
170 };
171 
173 
175 class Q_CORE_EXPORT QDebugStateSaver
176 {
177 public:
178  QDebugStateSaver(QDebug &dbg);
179  ~QDebugStateSaver();
180 private:
183 };
184 
185 class QNoDebug
186 {
187 public:
188  inline QNoDebug &operator<<(QTextStreamFunction) { return *this; }
189  inline QNoDebug &operator<<(QTextStreamManipulator) { return *this; }
190  inline QNoDebug &space() { return *this; }
191  inline QNoDebug &nospace() { return *this; }
192  inline QNoDebug &maybeSpace() { return *this; }
193  inline QNoDebug &quote() { return *this; }
194  inline QNoDebug &noquote() { return *this; }
195  inline QNoDebug &maybeQuote(const char = '"') { return *this; }
196  inline QNoDebug &verbosity(int) { return *this; }
197 
198  template<typename T>
199  inline QNoDebug &operator<<(const T &) { return *this; }
200 };
201 
203 {
204  QDebug{other}.swap(*this);
205  return *this;
206 }
207 
208 namespace QtPrivate {
209 
210 template <typename SequentialContainer>
211 inline QDebug printSequentialContainer(QDebug debug, const char *which, const SequentialContainer &c)
212 {
213  const QDebugStateSaver saver(debug);
214  debug.nospace() << which << '(';
215  typename SequentialContainer::const_iterator it = c.begin(), end = c.end();
216  if (it != end) {
217  debug << *it;
218  ++it;
219  }
220  while (it != end) {
221  debug << ", " << *it;
222  ++it;
223  }
224  debug << ')';
225  return debug;
226 }
227 
228 template <typename AssociativeContainer>
229 inline QDebug printAssociativeContainer(QDebug debug, const char *which, const AssociativeContainer &c)
230 {
231  const QDebugStateSaver saver(debug);
232  debug.nospace() << which << "(";
233  for (typename AssociativeContainer::const_iterator it = c.constBegin();
234  it != c.constEnd(); ++it) {
235  debug << '(' << it.key() << ", " << it.value() << ')';
236  }
237  debug << ')';
238  return debug;
239 }
240 
241 } // namespace QtPrivate
242 
243 template<typename ...T>
245  std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator<QDebug, T>...>, QDebug>;
246 
247 template<typename Container, typename ...T>
249  std::enable_if_t<std::conjunction_v<QTypeTraits::has_ostream_operator_container<QDebug, Container, T>...>, QDebug>;
250 
251 #ifndef Q_CLANG_QDOC
252 
253 template<typename T>
255 {
257 }
258 
259 template<typename T, qsizetype P>
261 {
262  return QtPrivate::printSequentialContainer(debug, "QVarLengthArray", vec);
263 }
264 
265 template <typename T, typename Alloc>
266 inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const std::vector<T, Alloc> &vec)
267 {
268  return QtPrivate::printSequentialContainer(debug, "std::vector", vec);
269 }
270 
271 template <typename T, typename Alloc>
272 inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const std::list<T, Alloc> &vec)
273 {
274  return QtPrivate::printSequentialContainer(debug, "std::list", vec);
275 }
276 
277 template <typename Key, typename T, typename Compare, typename Alloc>
278 inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map)
279 {
280  return QtPrivate::printSequentialContainer(debug, "std::map", map); // yes, sequential: *it is std::pair
281 }
282 
283 template <typename Key, typename T, typename Compare, typename Alloc>
284 inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const std::multimap<Key, T, Compare, Alloc> &map)
285 {
286  return QtPrivate::printSequentialContainer(debug, "std::multimap", map); // yes, sequential: *it is std::pair
287 }
288 
289 template <class Key, class T>
291 {
293 }
294 
295 template <class Key, class T>
297 {
298  return QtPrivate::printAssociativeContainer(debug, "QMultiMap", map);
299 }
300 
301 template <class Key, class T>
303 {
305 }
306 
307 template <class Key, class T>
309 {
310  return QtPrivate::printAssociativeContainer(debug, "QMultiHash", hash);
311 }
312 
313 template <class T1, class T2>
314 inline QDebugIfHasDebugStream<T1, T2> operator<<(QDebug debug, const std::pair<T1, T2> &pair)
315 {
316  const QDebugStateSaver saver(debug);
317  debug.nospace() << "std::pair(" << pair.first << ',' << pair.second << ')';
318  return debug;
319 }
320 
321 template <typename T>
323 {
325 }
326 
327 template <class T>
329 {
330  const QDebugStateSaver saver(debug);
331  debug.nospace() << "QContiguousCache(";
332  for (int i = cache.firstIndex(); i <= cache.lastIndex(); ++i) {
333  debug << cache[i];
334  if (i != cache.lastIndex())
335  debug << ", ";
336  }
337  debug << ')';
338  return debug;
339 }
340 
341 #else
342 template <class T>
344 
345 template <class T, qsizetype P>
347 
348 template <typename T, typename Alloc>
349 QDebug operator<<(QDebug debug, const std::vector<T, Alloc> &vec);
350 
351 template <typename T, typename Alloc>
352 QDebug operator<<(QDebug debug, const std::list<T, Alloc> &vec);
353 
354 template <typename Key, typename T, typename Compare, typename Alloc>
355 QDebug operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map);
356 
357 template <typename Key, typename T, typename Compare, typename Alloc>
358 QDebug operator<<(QDebug debug, const std::multimap<Key, T, Compare, Alloc> &map);
359 
360 template <class Key, class T>
362 
363 template <class Key, class T>
365 
366 template <class Key, class T>
368 
369 template <class Key, class T>
371 
372 template <typename T>
374 
375 template <class T1, class T2>
377 
378 template <class T1, class T2>
379 QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair);
380 
381 template <typename T>
383 
384 #endif // Q_CLANG_QDOC
385 
386 template <class T>
388 {
389  QDebugStateSaver saver(debug);
390  debug.nospace() << "QSharedPointer(" << ptr.data() << ")";
391  return debug;
392 }
393 
394 template <typename T, typename Tag> class QTaggedPointer;
395 
396 template <typename T, typename Tag>
398 {
399  QDebugStateSaver saver(debug);
400  debug.nospace() << "QTaggedPointer(" << ptr.pointer() << ", " << ptr.tag() << ")";
401  return debug;
402 }
403 
404 Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value);
405 
406 template <typename Int>
408 {
409  const QDebugStateSaver saver(debug);
410  debug.resetFormat();
411  debug.nospace() << "QFlags(" << Qt::hex << Qt::showbase;
412  bool needSeparator = false;
413  for (uint i = 0; i < sizeofT * 8; ++i) {
414  if (value & (Int(1) << i)) {
415  if (needSeparator)
416  debug << '|';
417  else
418  needSeparator = true;
419  debug << (Int(1) << i);
420  }
421  }
422  debug << ')';
423 }
424 
425 #if !defined(QT_NO_QOBJECT) && !defined(Q_QDOC)
426 Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, qint64 value, const QMetaObject *meta, const char *name);
427 Q_CORE_EXPORT QDebug qt_QMetaEnum_flagDebugOperator(QDebug &dbg, quint64 value, const QMetaObject *meta, const char *name);
428 
429 template<typename T>
431 operator<<(QDebug dbg, T value)
432 {
434  const char *name = qt_getEnumName(value);
435  return qt_QMetaEnum_debugOperator(dbg, static_cast<typename std::underlying_type<T>::type>(value), obj, name);
436 }
437 
438 template<typename T,
439  typename A = typename std::enable_if<std::is_enum<T>::value, void>::type,
440  typename B = typename std::enable_if<sizeof(T) <= sizeof(int), void>::type,
442  typename D = typename std::enable_if<QtPrivate::IsQEnumHelper<QFlags<T>>::Value, void>::type>
443 inline QDebug operator<<(QDebug dbg, T value)
444 {
445  typedef QFlags<T> FlagsT;
446  const QMetaObject *obj = qt_getEnumMetaObject(FlagsT());
447  const char *name = qt_getEnumName(FlagsT());
448  return qt_QMetaEnum_debugOperator(dbg, typename FlagsT::Int(value), obj, name);
449 }
450 
451 template <class T>
452 inline typename std::enable_if<
454  QDebug>::type
455 qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
456 {
458  const char *name = qt_getEnumName(T());
460 }
461 
462 template <class T>
463 inline typename std::enable_if<
465  QDebug>::type
466 qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
467 #else // !QT_NO_QOBJECT && !Q_QDOC
468 template <class T>
469 inline QDebug qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags)
470 #endif
471 {
473  return debug;
474 }
475 
476 template<typename T>
478 {
479  // We have to use an indirection otherwise specialisation of some other overload of the
480  // operator<< the compiler would try to instantiate QFlags<T> for the std::enable_if
481  return qt_QMetaEnum_flagDebugOperator_helper(debug, flags);
482 }
483 
484 inline QDebug operator<<(QDebug debug, QKeyCombination combination)
485 {
486  QDebugStateSaver saver(debug);
487  debug.nospace() << "QKeyCombination("
488  << combination.keyboardModifiers()
489  << ", "
490  << combination.key()
491  << ")";
492  return debug;
493 }
494 
495 #ifdef Q_OS_MAC
496 
497 // We provide QDebug stream operators for commonly used Core Foundation
498 // and Core Graphics types, as well as NSObject. Additional CF/CG types
499 // may be added by the user, using Q_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE.
500 
501 #define QT_FOR_EACH_CORE_FOUNDATION_TYPE(F) \
502  F(CFArray) \
503  F(CFURL) \
504  F(CFData) \
505  F(CFNumber) \
506  F(CFDictionary) \
507  F(CFLocale) \
508  F(CFDate) \
509  F(CFBoolean) \
510  F(CFTimeZone) \
511 
512 #define QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(F) \
513  F(CFError) \
514  F(CFBundle) \
515 
516 #define QT_FOR_EACH_CORE_GRAPHICS_TYPE(F) \
517  F(CGPath) \
518 
519 #define QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(F) \
520  F(CGColorSpace) \
521  F(CGImage) \
522  F(CGFont) \
523  F(CGColor) \
524 
525 #define QT_FORWARD_DECLARE_CF_TYPE(type) Q_FORWARD_DECLARE_CF_TYPE(type);
526 #define QT_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type);
527 #define QT_FORWARD_DECLARE_CG_TYPE(type) Q_FORWARD_DECLARE_CG_TYPE(type);
528 #define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type);
529 
531 Q_FORWARD_DECLARE_CF_TYPE(CFString);
533 QT_FOR_EACH_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_CF_TYPE)
534 QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_MUTABLE_CF_TYPE)
535 QT_FOR_EACH_CORE_GRAPHICS_TYPE(QT_FORWARD_DECLARE_CG_TYPE)
536 QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_FORWARD_DECLARE_MUTABLE_CG_TYPE)
538 
539 #define QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE(CFType) \
540  Q_CORE_EXPORT QDebug operator<<(QDebug, CFType##Ref);
541 
542 #define Q_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE(CFType) \
543  QDebug operator<<(QDebug debug, CFType##Ref ref) \
544  { \
545  if (!ref) \
546  return debug << QT_STRINGIFY(CFType) "Ref(0x0)"; \
547  if (CFStringRef description = CFCopyDescription(ref)) { \
548  QDebugStateSaver saver(debug); \
549  debug.noquote() << description; \
550  CFRelease(description); \
551  } \
552  return debug; \
553  }
554 
555 // Defined in qcore_mac_objc.mm
556 Q_CORE_EXPORT QDebug operator<<(QDebug, const NSObject *);
557 Q_CORE_EXPORT QDebug operator<<(QDebug, CFStringRef);
558 
559 QT_FOR_EACH_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE)
560 QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE)
561 QT_FOR_EACH_CORE_GRAPHICS_TYPE(QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE)
562 QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF_TYPE)
563 
564 #undef QT_FORWARD_DECLARE_CF_TYPE
565 #undef QT_FORWARD_DECLARE_MUTABLE_CF_TYPE
566 #undef QT_FORWARD_DECLARE_CG_TYPE
567 #undef QT_FORWARD_DECLARE_MUTABLE_CG_TYPE
568 
569 #endif // Q_OS_MAC
570 
572 
573 #endif // QDEBUG_H
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
#define value
[5]
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:85
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:84
The QContiguousCache class is a template class that provides a contiguous cache.\reentrant.
operator<<(QDataStream &ds, qfloat16 f)
Definition: qfloat16.cpp:327
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:65
QDebug & operator<<(const QString &t)
Definition: qdebug.h:145
QDebug & operator<<(QTextStreamManipulator m)
Definition: qdebug.h:159
QDebug(QString *string)
Definition: qdebug.h:101
QDebug & operator<<(quint64 t)
Definition: qdebug.h:139
QDebug & operator<<(char32_t t)
Definition: qdebug.h:133
QDebug & verbosity(int verbosityLevel)
Definition: qdebug.h:115
void setAutoInsertSpaces(bool b)
Definition: qdebug.h:121
QDebug & operator<<(signed int t)
Definition: qdebug.h:134
QDebug & operator<<(const QByteArray &t)
Definition: qdebug.h:150
QDebug & operator<<(unsigned long t)
Definition: qdebug.h:137
static QString toString(T &&object)
Definition: qdebug.h:163
QDebug & operator<<(const void *t)
Definition: qdebug.h:152
QDebug & operator<<(QLatin1String t)
Definition: qdebug.h:149
QDebug(QIODevice *device)
Definition: qdebug.h:100
void setVerbosity(int verbosityLevel)
Definition: qdebug.h:117
QDebug & operator<<(qint64 t)
Definition: qdebug.h:138
QDebug(QDebug &&other) noexcept
Definition: qdebug.h:104
QDebug & operator<<(const char *t)
Definition: qdebug.h:142
QDebug(QtMsgType t)
Definition: qdebug.h:102
QDebug & operator<<(signed long t)
Definition: qdebug.h:136
QDebug & operator<<(float t)
Definition: qdebug.h:140
QDebug & operator<<(QStringView s)
Definition: qdebug.h:147
int verbosity() const
Definition: qdebug.h:116
QDebug & operator<<(signed short t)
Definition: qdebug.h:130
QDebug & operator<<(QUtf8StringView s)
Definition: qdebug.h:148
bool autoInsertSpaces() const
Definition: qdebug.h:120
QDebug & operator<<(char16_t t)
Definition: qdebug.h:132
void swap(QDebug &other) noexcept
Definition: qdebug.h:108
QDebug & operator<<(double t)
Definition: qdebug.h:141
QDebug & maybeSpace()
Definition: qdebug.h:114
QDebug & operator<<(bool t)
Definition: qdebug.h:128
QDebug & operator<<(char t)
Definition: qdebug.h:129
QDebug & operator<<(QChar t)
Definition: qdebug.h:127
QDebug & maybeQuote(char c='"')
Definition: qdebug.h:125
QDebug & operator<<(const char16_t *t)
Definition: qdebug.h:143
QDebug & operator<<(unsigned int t)
Definition: qdebug.h:135
QDebug & noquote()
Definition: qdebug.h:124
QDebug & nospace()
Definition: qdebug.h:113
QDebug & operator=(const QDebug &other)
Definition: qdebug.h:202
QDebug & operator<<(unsigned short t)
Definition: qdebug.h:131
QDebug & quote()
Definition: qdebug.h:123
VerbosityLevel
Definition: qdebug.h:118
QDebug & operator<<(std::nullptr_t)
Definition: qdebug.h:153
QDebug & space()
Definition: qdebug.h:112
QDebug & operator<<(QByteArrayView t)
Definition: qdebug.h:151
QDebug & operator<<(QTextStreamFunction f)
Definition: qdebug.h:154
QDebug(const QDebug &o)
Definition: qdebug.h:103
Convenience class for custom QDebug operators.
Definition: qdebug.h:176
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
Definition: qflags.h:89
std::conditional< std::is_unsigned< typename std::underlying_type< Enum >::type >::value, unsigned int, signed int >::type Int
Definition: qflags.h:92
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qhash.h:773
Base class for QIODevice that provides flags describing the mode in which a device is opened.
Definition: qiodevicebase.h:48
The QIODevice class is the base interface class of all I/O devices in Qt.
Definition: qiodevice.h:70
constexpr Qt::Key key() const noexcept
Definition: qnamespace.h:1892
constexpr Qt::KeyboardModifiers keyboardModifiers() const noexcept
Definition: qnamespace.h:1887
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
Definition: qstring.h:84
Definition: qlist.h:108
Definition: qmap.h:222
The QMessageLogContext class provides additional information about a log message.
Definition: qlogging.h:70
The QMessageLogger class generates log messages.
Definition: qlogging.h:93
The QMultiHash class is a convenience QHash subclass that provides multi-valued hashes.
Definition: qhash.h:1293
QNoDebug & noquote()
Definition: qdebug.h:194
QNoDebug & verbosity(int)
Definition: qdebug.h:196
QNoDebug & operator<<(const T &)
Definition: qdebug.h:199
QNoDebug & maybeQuote(const char='"')
Definition: qdebug.h:195
QNoDebug & operator<<(QTextStreamManipulator)
Definition: qdebug.h:189
QNoDebug & operator<<(QTextStreamFunction)
Definition: qdebug.h:188
QNoDebug & nospace()
Definition: qdebug.h:191
QNoDebug & quote()
Definition: qdebug.h:193
QNoDebug & space()
Definition: qdebug.h:190
QNoDebug & maybeSpace()
Definition: qdebug.h:192
Definition: qset.h:54
The QSharedPointer class holds a strong reference to a shared pointer.
T * data() const noexcept
The QString class provides a Unicode character string.
Definition: qstring.h:388
static QString fromUtf8(QByteArrayView utf8)
Definition: qstring.cpp:5632
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
Definition: qstringview.h:122
Tag tag() const noexcept
The QTextStream class provides a convenient interface for reading and writing text.
Definition: qtextstream.h:62
#define T(x)
Definition: main.cpp:42
QHash< int, QWidget * > hash
[35multi]
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
FT_Vector * vec
Definition: ftbbox.c:469
#define true
Definition: ftrandom.c:51
int Int
Definition: ftraster.c:307
HBUINT16 Value
typename C::const_iterator const_iterator
QTextStream & hex(QTextStream &stream)
QTextStream & showbase(QTextStream &stream)
QDebug printAssociativeContainer(QDebug debug, const char *which, const AssociativeContainer &c)
Definition: qdebug.h:229
QDebug printSequentialContainer(QDebug debug, const char *which, const SequentialContainer &c)
Definition: qdebug.h:211
char qt_getEnumMetaObject(const T &)
std::pair< T1, T2 > QPair
Definition: qcontainerfwd.h:56
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)
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject)
Q_FORWARD_DECLARE_CF_TYPE(CTFontDescriptor)
std::enable_if_t< std::conjunction_v< QTypeTraits::has_ostream_operator_container< QDebug, Container, T >... >, QDebug > QDebugIfHasDebugStreamContainer
Definition: qdebug.h:249
std::enable_if_t< std::conjunction_v< QTypeTraits::has_ostream_operator< QDebug, T >... >, QDebug > QDebugIfHasDebugStream
Definition: qdebug.h:245
Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug &, qint64 value, const QMetaObject *meta, const char *name)
Definition: qdebug.cpp:1082
Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value)
Definition: qdebug.h:407
EGLStreamKHR stream
EGLOutputLayerEXT EGLint EGLAttrib value
unsigned long long quint64
Definition: qglobal.h:299
unsigned int uint
Definition: qglobal.h:334
long long qint64
Definition: qglobal.h:298
#define Q_DISABLE_COPY(Class)
Definition: qglobal.h:515
unsigned short ushort
Definition: qglobal.h:333
#define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class)
Definition: qglobal.h:556
QtMsgType
Definition: qlogging.h:60
@ QtDebugMsg
Definition: qlogging.h:61
GLenum GLuint GLenum GLsizei length
Definition: qopengl.h:270
GLenum type
Definition: qopengl.h:270
GLboolean GLboolean GLboolean b
const GLfloat * m
GLuint GLuint end
GLfloat GLfloat f
GLenum GLuint buffer
GLbitfield flags
GLint ref
GLuint name
GLhandleARB obj
[2]
Definition: qopenglext.h:4164
const GLubyte * c
Definition: qopenglext.h:12701
GLenum array
Definition: qopenglext.h:7028
GLdouble GLdouble t
[9]
Definition: qopenglext.h:243
GLdouble s
[6]
Definition: qopenglext.h:235
GLsizei const GLchar *const * string
[0]
Definition: qopenglext.h:694
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QTextStream &(* QTextStreamFunction)(QTextStream &)
Definition: qtextstream.h:204
#define Q_DECLARE_SHARED(TYPE)
Definition: qtypeinfo.h:197
QFuture< QSet< QChar > > set
[10]
QSharedPointer< T > other(t)
[5]
QStringList::Iterator it
QStringList list
[0]
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:165
Definition: main.cpp:38