QDebug Class

QDebug 类为调试信息提供输出流。更多

头文件: #include <QDebug>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
继承: QIODeviceBase
继承者:

QQmlInfo

公共类型

enum VerbosityLevel { MinimumVerbosity, DefaultVerbosity, MaximumVerbosity }

公共函数

QDebug(QIODevice *device)
QDebug(QString *string)
QDebug(QtMsgType t)
QDebug(const QDebug &o)
~QDebug()
bool autoInsertSpaces() const
QDebug &maybeQuote(char c = '"')
QDebug &maybeSpace()
QDebug &noquote()
QDebug &nospace()
QDebug &quote()
(since 6.7) bool quoteStrings() const
QDebug &resetFormat()
void setAutoInsertSpaces(bool b)
(since 6.7) void setQuoteStrings(bool b)
void setVerbosity(int verbosityLevel)
QDebug &space()
void swap(QDebug &other)
int verbosity() const
QDebug &verbosity(int verbosityLevel)
(since 6.0) QDebug &operator<<(QByteArrayView t)
QDebug &operator<<(QChar t)
QDebug &operator<<(QLatin1StringView t)
QDebug &operator<<(QStringView s)
(since 6.0) QDebug &operator<<(QUtf8StringView s)
(since 6.7) QDebug &operator<<(T i)
(since 6.7) QDebug &operator<<(T i)
QDebug &operator<<(bool t)
QDebug &operator<<(char t)
QDebug &operator<<(char16_t t)
QDebug &operator<<(char32_t t)
QDebug &operator<<(const QByteArray &t)
QDebug &operator<<(const QString &t)
QDebug &operator<<(const char *t)
(since 6.0) QDebug &operator<<(const char16_t *t)
(since 6.5) QDebug &operator<<(const std::basic_string<Char, Args...> &s)
(since 6.7) QDebug &operator<<(const std::optional<T> &opt)
(since 6.9) QDebug &operator<<(const std::tuple<Ts...> &tuple)
QDebug &operator<<(const void *t)
QDebug &operator<<(double t)
QDebug &operator<<(float t)
QDebug &operator<<(int t)
QDebug &operator<<(long t)
QDebug &operator<<(qint64 t)
QDebug &operator<<(quint64 t)
QDebug &operator<<(short t)
(since 6.5) QDebug &operator<<(std::basic_string_view<Char, Args...> s)
(since 6.6) QDebug &operator<<(std::chrono::duration<Rep, Period> duration)
(since 6.7) QDebug &operator<<(std::nullopt_t)
QDebug &operator<<(unsigned int t)
QDebug &operator<<(unsigned long t)
QDebug &operator<<(unsigned short t)
QDebug &operator=(const QDebug &other)

静态公共成员

(since 6.9) QByteArray toBytes(const T &object)
(since 6.0) QString toString(const T &object)
QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
QDebug operator<<(QDebug debug, const QFlags<T> &flags)
QDebug operator<<(QDebug debug, const QHash<Key, T> &hash)
QDebug operator<<(QDebug debug, const QList<T> &list)
QDebug operator<<(QDebug debug, const QMap<Key, T> &map)
QDebug operator<<(QDebug debug, const QMultiHash<Key, T> &hash)
QDebug operator<<(QDebug debug, const QMultiMap<Key, T> &map)
QDebug operator<<(QDebug debug, const QSet<T> &set)
(since 6.3) QDebug operator<<(QDebug debug, const QVarLengthArray<T, P> &array)
(since 6.9) QDebug operator<<(QDebug debug, const std::array<T, N> &array)
QDebug operator<<(QDebug debug, const std::list<T, Alloc> &vec)
QDebug operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map)
QDebug operator<<(QDebug debug, const std::multimap<Key, T, Compare, Alloc> &map)
(since 6.9) QDebug operator<<(QDebug debug, const std::multiset<Key, Compare, Alloc> &multiset)
QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair)
(since 6.9) QDebug operator<<(QDebug debug, const std::set<Key, Compare, Alloc> &set)
(since 6.9) QDebug operator<<(QDebug debug, const std::unordered_map<Key, T, Hash, KeyEqual, Alloc> &map)
(since 6.9) QDebug operator<<(QDebug debug, const std::unordered_set<Key, Hash, KeyEqual, Alloc> &unordered_set)
QDebug operator<<(QDebug debug, const std::vector<T, Alloc> &vec)
(since 6.9) QDebug operator<<(QDebug debug, T t)

详细说明

当开发人员需要将调试或跟踪信息写入设备、文件、字符串或控制台时,就会用到 QDebug。

基本用法

在一般情况下,调用qDebug() 函数获取一个默认的 QDebug 对象,用于写入调试信息。

   qDebug()<< "日期:"<<QDate::currentDate();    qDebug() << "Types:" << QString("String") << QChar('x') << QRect(0, 10, 50, 40);
    qDebug() << "Custom coordinate type:" << coordinate;

这将使用接受QtMsgType 值为QtDebugMsg 的构造函数构造一个 QDebug 对象。类似地,qWarning(),qCritical() 和qFatal() 函数也会返回相应消息类型的 QDebug 对象。

该类还为其他情况提供了几个构造函数,包括一个接受QFile 或任何其他QIODevice 子类的构造函数,该子类用于将调试信息写入文件和其他设备。接受QString 的构造函数用于写入字符串,以便显示或序列化。

格式化选项

QDebug 会格式化输出,使其易于阅读。它会自动在参数之间添加空格,并在QString,QByteArray,QChar 参数周围添加引号。

您可以通过space(),nospace() 和quote(),noquote() 方法调整这些选项。此外,QTextStream manipulators 还可以通过管道导入 QDebug 流。

QDebugStateSaver 限制在当前范围内更改格式。() 将选项重置为默认选项。resetFormat

将自定义类型写入流

许多标准类型都可以写入 QDebug 对象,Qt 也为大多数 Qt 值类型提供了支持。要添加对自定义类型的支持,就需要实现流操作符,如下例所示:

QDebug operator<<(QDebug debug, const Coordinate &c)
{
    QDebugStateSaver saver(debug);
    debug.nospace() << '(' << c.x() << ", " << c.y() << ')';

    return debug;
}

调试技术创建自定义 Qt 类型文档对此进行了描述。

成员类型文档

enum QDebug::VerbosityLevel

该枚举描述了冗长程度的范围。

常量
QDebug::MinimumVerbosity0
QDebug::DefaultVerbosity2
QDebug::MaximumVerbosity7

另请参阅 verbosity() 和setVerbosity()。

成员函数文档

[since 6.5] template <typename Char, typename... Args> QDebug &QDebug::operator<<(const std::basic_string<Char, Args...> &s)

[since 6.5] template <typename Char, typename... Args> QDebug &QDebug::operator<<(std::basic_string_view<Char, Args...> s)

将字符串或字符串视图s 写入数据流,并返回对数据流的引用。

只有当Char 是以下字符之一时,这些操作符才会参与重载解析

  • 字符串
  • char8_t(仅限 C++20)
  • char16_t
  • char32_t
  • wchar_t

此函数在 Qt 6.5 中引入。

[since 6.7] template <typename T, QDebug::if_qint128<T> = true> QDebug &QDebug::operator<<(T i)

[since 6.7] template <typename T, QDebug::if_quint128<T> = true> QDebug &QDebug::operator<<(T i)

打印 128 位整数i 的文本表示。

注意: 只有 Qt 支持 128 位整数类型时,此操作符才可用。如果在编译时 128 位整数类型可用,但 Qt 库编译时不支持 128 位整数类型,则运算符将打印警告。

注意: 由于操作符是一个函数模板,因此不会对其参数执行隐式转换。它必须完全是 qint128/quint128。

此函数在 Qt 6.7 中引入。

另请参阅 QT_SUPPORTS_INT128

[explicit] QDebug::QDebug(QIODevice *device)

构建调试流,写入给定的device

[explicit] QDebug::QDebug(QString *string)

构建调试流,写入给定的string

[explicit] QDebug::QDebug(QtMsgType t)

构建调试流,写入t 消息类型的处理程序。

QDebug::QDebug(const QDebug &o)

构建另一个调试流的副本o

[noexcept] QDebug::~QDebug()

刷新所有待写数据并销毁调试流。

bool QDebug::autoInsertSpaces() const

如果QDebug 实例将在写入内容之间自动插入空格,则返回true

另请参阅 setAutoInsertSpaces() 和QDebugStateSaver

QDebug &QDebug::maybeQuote(char c = '"')

根据当前自动插入引号的设置,将字符c 写入调试流,并返回调试流的引用。

默认字符是双引号"

另请参阅 quote() 和noquote()。

QDebug &QDebug::maybeSpace()

根据当前自动插入空格的设置,向调试流写入空格字符,并返回调试流的引用。

另请参阅 space() 和nospace()。

QDebug &QDebug::noquote()

禁用在QCharQStringQByteArray 内容周围自动插入引号字符,并返回对数据流的引用。

禁用引号时,打印这些类型时不使用引号字符,也不转义不可打印字符。

另请参阅 quote() 和maybeQuote()。

QDebug &QDebug::nospace()

禁止自动插入空格,并返回对数据流的引用。

另请参阅 space() 和maybeSpace()。

QDebug &QDebug::quote()

启用在QCharQStringQByteArray 内容周围自动插入引号字符,并返回对数据流的引用。

默认情况下启用引号。

另请参阅 noquote() 和maybeQuote()。

[noexcept, since 6.7] bool QDebug::quoteStrings() const

如果QDebug 实例将引用流式字符串(默认情况),则返回true

此函数在 Qt 6.7 中引入。

另请参阅 QDebugStateSaver,quote(),noquote() 和setQuoteStrings()。

QDebug &QDebug::resetFormat()

重置数据流格式化选项,使其恢复到初始构造状态。

另请参阅 space() 和quote() 。

void QDebug::setAutoInsertSpaces(bool b)

如果b 为 true,则启用在写入内容之间自动插入空格;否则禁用自动插入空格。

另请参阅 autoInsertSpaces() 和QDebugStateSaver

[since 6.7] void QDebug::setQuoteStrings(bool b)

如果btrue ,则启用对流入此QDebug 实例的字符串加引号;否则禁用加引号。

默认情况下引用字符串。

此函数在 Qt 6.7 中引入。

另请参阅 QDebugStateSaver,quote(),noquote() 和quoteStrings()。

void QDebug::setVerbosity(int verbosityLevel)

将数据流的冗余度设置为verbosityLevel

允许的范围为 0 至 7。默认值为 2。

另请参阅 verbosity() 和VerbosityLevel

QDebug &QDebug::space()

向调试数据流写入空格字符,并返回对该数据流的引用。

以后写入时,数据流会记住已启用自动插入空格。

另请参阅 nospace() 和maybeSpace()。

[noexcept] void QDebug::swap(QDebug &other)

将此调试流实例与other 互换。此操作速度非常快,从未出现过故障。

[static, since 6.9] template <typename T> QByteArray QDebug::toBytes(const T &object)

这相当于将object 传递给QDebug::toString(object).toUtf8() ,但效率更高。

此函数在 Qt 6.9 中引入。

另请参阅 toString() 。

[static, since 6.0] template <typename T> QString QDebug::toString(const T &object)

objectQDebug 实例中,对字符串进行操作,然后返回该字符串。

在调试时需要对象的文本表示,但又无法使用operator<< 的情况下,该函数非常有用。例如

    QTRY_VERIFY2(list.isEmpty(), qPrintable(QString::fromLatin1(
        "Expected list to be empty, but it has the following items: %1")).arg(QDebug::toString(list)));

使用nospace() 对字符串进行流式处理。

此函数在 Qt 6.0 中引入。

另请参阅 toBytes()。

int QDebug::verbosity() const

返回调试流的冗长程度。

流操作员可以检查该值,以决定是否需要冗长输出,并根据级别打印更多信息。数值越大,表示需要更多信息。

允许值范围为 0 至 7。默认值为 2。

另请参阅 setVerbosity() 和VerbosityLevel

QDebug &QDebug::verbosity(int verbosityLevel)

将数据流的冗余度设置为verbosityLevel ,并返回该数据流的引用。

允许的范围是 0 到 7。默认值为 2。

另请参阅 verbosity(),setVerbosity() 和VerbosityLevel

[since 6.0] QDebug &QDebug::operator<<(QByteArrayView t)

将观察到的字节数组t 的数据写入数据流,并返回对数据流的引用。

通常,QDebug 在引号内打印数据,并将控制字符或非美标字符转换为 C 转义序列(\xAB)。这样,输出始终是干净的 7 位,必要时可以从输出中复制字符串并粘贴回 C++ 源中。

要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位干净字符。

有关示例,请参阅QByteArray 重载。

此函数在 Qt 6.0 中引入。

QDebug &QDebug::operator<<(QChar t)

将字符t 写入数据流,并返回对数据流的引用。通常,QDebug 会以 C 转义序列或 Unicode 值(\u1234)的形式打印控制字符和非 US-ASCII 字符。若要在不转换的情况下打印不可打印字符,可启用noquote() 功能,但要注意,某些QDebug 后端可能不是 8 位干净的,可能无法表示t

QDebug &QDebug::operator<<(QLatin1StringView t)

将字符串t 写入数据流,并返回对数据流的引用。通常,QDebug 会在引号内打印字符串,并将不可打印字符转换为 Unicode 值(\u1234)。

若要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位的。

有关示例,请参阅QString 重载。

QDebug &QDebug::operator<<(QStringView s)

将字符串视图s 写入数据流,并返回对数据流的引用。通常,QDebug 会在引号内打印字符串,并将不可打印字符转换为 Unicode 值(\u1234)。

若要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位的。

有关示例,请参阅QString 重载。

[since 6.0] QDebug &QDebug::operator<<(QUtf8StringView s)

将字符串视图s 写入数据流,并返回对数据流的引用。

通常,QDebug 在引号内打印数据,并将控制字符或非美标字符转换为 C 转义序列 (\xAB)。这样,输出始终是干净的 7 位,必要时可以从输出中复制字符串并粘贴回 C++ 源中。

要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位纯净的。

此功能在 Qt 6.0 中引入。

QDebug &QDebug::operator<<(bool t)

将布尔值t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(char t)

将字符t 写入数据流,并返回数据流的引用。

QDebug &QDebug::operator<<(char16_t t)

向数据流写入 UTF-16 字符t ,并返回对数据流的引用。

QDebug &QDebug::operator<<(char32_t t)

向数据流写入 UTF-32 字符t ,并返回对数据流的引用。

QDebug &QDebug::operator<<(const QByteArray &t)

将字节数组t 写入数据流,并返回对数据流的引用。通常,QDebug 在引号内打印数组,并将控制字符或非美标字符转换为 C 转义序列 (\xAB)。这样,输出始终是干净的 7 位,必要时可从输出中复制字符串并粘贴回 C++ 源中。

要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位干净字符。

输出示例

    QByteArrayba; ba= "a"    qDebug().noquote() << ba;    // prints: a
    qDebug() << ba;              // prints: "a"

    ba= "\"a\r\n\"qDebug() << ba;              // prints: "\"a\r\n\""

    ba= "\033";// 转义字符    qDebug() << ba;              // prints: "\x1B"

    ba= "\xC3\xA1"qDebug() << ba;              // prints: "\xC3\xA1"

    ba=QByteArray("a\0b", 3);    qDebug() << ba               // prints: "\a\x00""b"

请注意,QDebug 需要按照 C 和 C++ 语言连接字符串字面量的方式关闭和重新打开字符串,这样字母 "b "就不会被解释为之前十六进制转义序列的一部分。

QDebug &QDebug::operator<<(const QString &t)

将字符串t 写入数据流,并返回对数据流的引用。通常,QDebug 在引号内打印字符串,并将不可打印字符转换为 Unicode 值(\u1234)。

若要不经转换打印不可打印字符,请启用noquote() 功能。请注意,某些QDebug 后端可能不是 8 位干净的。

输出示例

    QStrings; s= "a"    qDebug().noquote() << s;    // prints: a
    qDebug() << s;              // prints: "a"

    s= "\"a\r\n\"qDebug() << s;              // prints: "\"a\r\n\""

    s= "\033";// 转义字符    qDebug() << s;              // prints: "\u001B"

    s= "\u00AD";// 软手写体    qDebug() << s;              // prints: "\u00AD"

    s= "\u00E1";// 带突号的拉丁小写字母 A    qDebug() << s;              // prints: "á"

    s= "a\u0301";// "a "后跟连读加重语气词    qDebug() << s;              // prints: "á";

    s= "\u0430\u0301";// CYRILLIC SMALL LETTER A,后跟连读重音符号    qDebug() << s;              // prints: "а́"

QDebug &QDebug::operator<<(const char *t)

将以'\0'结尾的 UTF-8 字符串t 写入数据流,并返回对数据流的引用。输出时,字符串不会加引号或转义。请注意,QDebug 内部缓冲为 UTF-16,可能需要使用本地编解码器转换为 8 位,以便使用某些后端,这可能导致乱码输出(mojibake)。建议限制使用 US-ASCII 字符串。

[since 6.0] QDebug &QDebug::operator<<(const char16_t *t)

将以 u'\0' 结尾的 UTF-16 字符串t 写入数据流,并返回对数据流的引用。输出时,字符串不会加引号或转义。请注意,QDebug 内部缓冲为 UTF-16,可能需要使用本地编解码器转换为 8 位才能使用某些后端,这可能会导致乱码输出(mojibake)。建议限制使用 US-ASCII 字符串。

此函数在 Qt 6.0 中引入。

[since 6.7] template <typename T, QDebug::if_streamable<T> = true> QDebug &QDebug::operator<<(const std::optional<T> &opt)

opt (或nullopt ,如果未设置)的内容写入此流。T 需要支持流式传输到QDebug

此函数在 Qt 6.7 中引入。

[since 6.9] template <typename... Ts, QDebug::if_streamable<Ts...> = true> QDebug &QDebug::operator<<(const std::tuple<Ts...> &tuple)

tuple 的内容写入流。所有Ts... 都需要支持流式传输到QDebug

此函数在 Qt 6.9 中引入。

QDebug &QDebug::operator<<(const void *t)

将指针t 写入数据流,并返回数据流的引用。

QDebug &QDebug::operator<<(double t)

将 64 位浮点数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(float t)

将 32 位浮点数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(int t)

将带符号整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(long t)

将带符号长整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(qint64 t)

将带符号的 64 位整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(quint64 t)

将无符号 64 位整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(short t)

将带符号的短整数t 写入数据流,并返回对数据流的引用。

[since 6.6] template <typename Rep, typename Period> QDebug &QDebug::operator<<(std::chrono::duration<Rep, Period> duration)

将时间长度duration 打印到数据流,并返回对数据流的引用。打印出的字符串是时间段的数字表示,后面是时间单位,类似于 C++ 标准库中的std::ostream

单位未本地化。

此函数在 Qt 6.6 中引入。

[since 6.7] QDebug &QDebug::operator<<(std::nullopt_t)

将 nullopt 写入数据流。

此函数在 Qt 6.7 中引入。

QDebug &QDebug::operator<<(unsigned int t)

将无符号整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(unsigned long t)

将无符号长整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator<<(unsigned short t)

将无符号短整数t 写入数据流,并返回对数据流的引用。

QDebug &QDebug::operator=(const QDebug &other)

other 调试流分配给此流,并返回此流的引用。

相关非成员

template <typename T> QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)

cache 的内容写入debugT 需要支持流式传输到QDebug

template <typename T> QDebug operator<<(QDebug debug, const QFlags<T> &flags)

flags 写入debug

template <typename Key, typename T> QDebug operator<<(QDebug debug, const QHash<Key, T> &hash)

hash 的内容写入debugKeyT 都需要支持流式输入QDebug

template <typename T> QDebug operator<<(QDebug debug, const QList<T> &list)

list 的内容写入debugT 需要支持流式传输到QDebug

template <typename Key, typename T> QDebug operator<<(QDebug debug, const QMap<Key, T> &map)

map 的内容写入debugKeyT 都需要支持流式输入QDebug

template <typename Key, typename T> QDebug operator<<(QDebug debug, const QMultiHash<Key, T> &hash)

hash 的内容写入debugKeyT 都需要支持流式输入QDebug

template <typename Key, typename T> QDebug operator<<(QDebug debug, const QMultiMap<Key, T> &map)

map 的内容写入debugKeyT 都需要支持流式输入QDebug

template <typename T> QDebug operator<<(QDebug debug, const QSet<T> &set)

set 的内容写入debugT 需要支持流式传输到QDebug

[since 6.3] template <typename T, qsizetype P> QDebug operator<<(QDebug debug, const QVarLengthArray<T, P> &array)

array 中的内容写入debugT 需要支持流式传输到QDebug

此函数在 Qt 6.3 中引入。

[since 6.9] template <typename T, std::size_t N> QDebug operator<<(QDebug debug, const std::array<T, N> &array)

array 中的内容写入debugT 需要支持流式传输到QDebug

此函数在 Qt 6.9 中引入。

template <typename T, typename Alloc> QDebug operator<<(QDebug debug, const std::list<T, Alloc> &vec)

将列表vec 中的内容写入debugT 需要支持流式输入QDebug

template <typename Key, typename T, typename Compare, typename Alloc> QDebug operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map)

map 的内容写入debugKeyT 都需要支持流式输入QDebug

template <typename Key, typename T, typename Compare, typename Alloc> QDebug operator<<(QDebug debug, const std::multimap<Key, T, Compare, Alloc> &map)

map 的内容写入debugKeyT 都需要支持流式输入QDebug

[since 6.9] template <typename Key, typename Compare, typename Alloc> QDebug operator<<(QDebug debug, const std::multiset<Key, Compare, Alloc> &multiset)

multiset 中的内容写入debugKey 类型需要支持流式输入QDebug

该函数在 Qt 6.9 中引入。

template <typename T1, typename T2> QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair)

pair 的内容写入debugT1T2 都需要支持流式输入QDebug

[since 6.9] template <typename Key, typename Compare, typename Alloc> QDebug operator<<(QDebug debug, const std::set<Key, Compare, Alloc> &set)

set 中的内容写入debugKey 类型需要支持流式输入QDebug

该函数在 Qt 6.9 中引入。

[since 6.9] template <typename Key, typename T, typename Hash, typename KeyEqual, typename Alloc> QDebug operator<<(QDebug debug, const std::unordered_map<Key, T, Hash, KeyEqual, Alloc> &map)

map 中的内容写入debugKeyT 都需要支持流式输入QDebug

此函数在 Qt 6.9 中引入。

[since 6.9] template <typename Key, typename Hash, typename KeyEqual, typename Alloc> QDebug operator<<(QDebug debug, const std::unordered_set<Key, Hash, KeyEqual, Alloc> &unordered_set)

unordered_set 中的内容写入debugKey 类型需要支持流式输入QDebug

该函数在 Qt 6.9 中引入。

template <typename T, typename Alloc> QDebug operator<<(QDebug debug, const std::vector<T, Alloc> &vec)

vec 向量的内容写入debugT 需要支持流式输入QDebug

[since 6.9] template <typename T, QDebug::if_ordering_type<T> = true> QDebug operator<<(QDebug debug, T t)

将 Qt XML 或 std 排序值t 打印到debug 对象。

限制条件

只有当T 是 <Qt/Std>::<weak/partial/strong>_ordering 之一时,才参与重载解析。

此函数在 Qt 6.9 中引入。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.