QVariantConstPointer Class
| 头文件: | #include <QVariantConstPointer> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core)target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 自 | Qt 6.0 |
| 状态: | 直到 6.15 |
该类计划在 6.15 版本中停用。
公共函数
| QVariantConstPointer(QVariant variant) | |
| QVariant | operator*() const |
| const QVariant * | operator->() const |
详细说明
使用QVariant::ConstPointer 代替。
QVariantConstPointer 封装了一个QVariant ,并从其 operator*() 中返回。这使它适合替代实际的常量指针。我们不能从泛型迭代器中返回实际的常指针,因为迭代器并不持有实际的QVariant 。
© 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.