QVariantPointer 类

template <typename Pointer> class QVariantPointer

QVariantPointer 是模拟指针的模板类,指向 QVariant 基于指针。 更多...

头: #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 )

构造 QVariantPointer 从给定 pointer .

QVariantRef < Pointer > QVariantPointer:: operator* () const

解引用 QVariantPointer QVariantRef .

Pointer QVariantPointer:: operator-> () const

解引用并返回指针。还期望指针实现操作符->()。