本页内容

QDBusObjectPath Class

QDBusObjectPath 类使程序员能够识别 D-Bus 类型系统提供的 OBJECT_PATH 类型。更多内容...

头文件: #include <QDBusObjectPath>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus

公共函数

QDBusObjectPath()
QDBusObjectPath(QLatin1StringView path)
QDBusObjectPath(const QString &path)
QDBusObjectPath(const char *path)
QString path() const
void setPath(const QString &path)
void swap(QDBusObjectPath &other)
operator QVariant() const
(since 6.8) QDebug operator<<(QDebug dbg, const QDBusObjectPath &path)

详细说明

另请参阅 Qt D-Bus 类型系统。

成员函数文档

[noexcept] QDBusObjectPath::QDBusObjectPath()

创建一个新的对象路径。

[explicit] QDBusObjectPath::QDBusObjectPath(QLatin1StringView path)

根据path 所处理的Latin-1字符串,构建一个新的对象路径。

[explicit] QDBusObjectPath::QDBusObjectPath(const QString &path)

根据给定的path 构建一个新的对象路径。

[explicit] QDBusObjectPath::QDBusObjectPath(const char *path)

根据给定的path 构建一个新的对象路径。

另请参阅 setPath()。

QString QDBusObjectPath::path() const

返回此对象路径。

另请参阅 setPath()。

void QDBusObjectPath::setPath(const QString &path)

将给定的path 的值赋给此对象路径。

另请参阅 path()。

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

将该对象路径与other 互换。此操作速度极快,且绝不会失败。

QDBusObjectPath::operator QVariant() const

隐式转换为QVariant 。相当于将该对象作为参数调用QVariant::fromValue()。

相关的非成员

[since 6.8] QDebug operator<<(QDebug dbg, const QDBusObjectPath &path)

将path 的内容写入dbg 。

该函数在 Qt 6.8 中引入。

© 2026 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.