QVariantPointer is a template class that emulates a pointer to QVariant based on a pointer. 更多...
| 頭: | #include <QVariantPointer> |
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Core)
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 .
[explicit]
QVariantPointer::
QVariantPointer
(const
Pointer
*
pointer
)
Constructs a QVariantPointer from the given pointer .
解引用 QVariantPointer 到 QVariantRef .
Dereferences and returns the pointer. The pointer is expected to also implement operator->().