QVariantPointer Class
template <typename Pointer> class QVariantPointerQVariantPointer 是一个模板类,它基于指针模拟指向QVariant 的指针。更多
Header: | #include <QVariantPointer> |
CMake.QVariantPointer | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
自 | Qt 6.0 |
公共函数
QVariantPointer(const Pointer *pointer) | |
QVariantRef<Pointer> | operator*() const |
Pointer | operator->() const |
详细说明
QVariantConstPointer 封装指针,并从其 operator*() 返回 。这使它适合替代实际指针。我们不能从泛型迭代器中返回实际指针,因为迭代器并不持有实际的 。QVariantRef QVariant
成员函数文档
[explicit]
QVariantPointer::QVariantPointer(const Pointer *pointer)
从给定的pointer 中构造一个 QVariantPointer。
QVariantRef<Pointer> QVariantPointer::operator*() const
取消引用QVariantPointer 到QVariantRef 。
Pointer QVariantPointer::operator->() const
取消引用并返回指针。预计指针也会实现 operator->()。
© 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.