6.0.0-rc4Source

QScopedArrayPointer Class

template <typename T> class QScopedArrayPointer

The QScopedArrayPointer class stores a pointer to a dynamically allocated array and deletes it on destruction. More…

Header#include <QScopedArrayPointer>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
InheritsQScopedPointer

List of all members, including inherited members

Public Functions

QScopedArrayPointer(T *p = nullptr)
T &operator[](qsizetype i) const

Detailed Description

QScopedArrayPointer is a QScopedPointer that cleans up with delete[] and provides indexed access to the elements.

See also QScopedPointer.

Differences from Qt

The constructor and reset() accept only T *, not a pointer to a different type.

Member Function Documentation

[explicit] QScopedArrayPointer::QScopedArrayPointer(T *p = nullptr)

Constructs a scoped array pointer that owns the array p. The default is a null pointer.

T & QScopedArrayPointer::operator[](qsizetype i) const

Returns a reference to the element at index i. There is no bounds checking.