QVariantConstPointer 类

模拟常量指针指向 QVariant 基于指针。 更多...

头: #include <QVariantConstPointer>
CMake: find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0

公共函数

  QVariantConstPointer (QVariant variant )
QVariant operator* () const
const QVariant * operator-> () const

详细描述

QVariantConstPointer wraps a QVariant and returns it from its operator*(). This makes it suitable as replacement for an actual const pointer. We cannot return an actual const pointer from generic iterators as the iterators don't hold an actual QVariant .

成员函数文档编制

QVariantConstPointer:: QVariantConstPointer ( QVariant variant )

Constructs a QVariantConstPointer from a variant .

QVariant QVariantConstPointer:: operator* () const

解引用 QVariantConstPointer to retrieve its internal QVariant .

const QVariant *QVariantConstPointer:: operator-> () const

Returns a const pointer to the QVariant , conforming to the conventions for operator->().