QSharedData Class
QSharedData 类是共享数据对象的基类。更多内容...
| 头文件: | #include <QSharedData> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
注意:该类中的所有函数均为可重入函数。
公共函数
| QSharedData() | |
| QSharedData(const QSharedData &) | |
| ~QSharedData() | |
| QSharedData & | operator=(const QSharedData &) |
详细说明
QSharedData 旨在与QSharedDataPointer 或QExplicitlySharedDataPointer 配合使用,以实现自定义的隐式共享或显式共享类。QSharedData 提供了线程安全的引用计数机制。
成员函数文档
[noexcept] QSharedData::QSharedData()
创建一个引用计数为 0 的 QSharedData 对象。
[noexcept] QSharedData::QSharedData(const QSharedData &)
创建一个引用计数为 0 的 QSharedData 对象。该参数将被忽略。
[constexpr noexcept default] QSharedData::~QSharedData()
销毁QSharedData 的实例。
[delete] QSharedData &QSharedData::operator=(const QSharedData &)
将other 复制并赋值给此QSharedData 实例。该函数已被删除。
© 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.