QVariantPointer 是模拟指针的模板类,指向 QVariant 基于指针。 更多...
| 头: | #include <QVariantPointer> |
| CMake: |
find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Since: | Qt 6.0 |
| QVariantPointer (const Pointer * pointer ) | |
| QVariantRef<Pointer> | operator* () const |
| Pointer | operator-> () const |
QVariantConstPointer wraps a pointer and returns QVariantRef to it from its operator*(). This makes it suitable as replacement for an actual pointer. We cannot return an actual pointer from generic iterators as the iterators don't hold an actual QVariant .
构造 QVariantPointer 从给定 pointer .
解引用 QVariantPointer 到 QVariantRef .
解引用并返回指针。还期望指针实现操作符->()。