Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QScopedPointer< T, Cleanup > Class Template Reference

\inmodule QtCore More...

#include <qscopedpointer.h>

+ Inheritance diagram for QScopedPointer< T, Cleanup >:
+ Collaboration diagram for QScopedPointer< T, Cleanup >:

Public Types

typedef T * pointer
 

Public Member Functions

Q_NODISCARD_CTOR QScopedPointer (T *p=nullptr) noexcept
 Constructs this QScopedPointer instance and sets its pointer to p.
 
 ~QScopedPointer ()
 Destroys this QScopedPointer object.
 
T & operator* () const
 Provides access to the scoped pointer's object.
 
T * operator-> () const noexcept
 Provides access to the scoped pointer's object.
 
bool operator! () const noexcept
 Returns true if this object refers to \nullptr.
 
 operator bool () const
 Returns true if the contained pointer is not \nullptr.
 
T * data () const noexcept
 Returns the value of the pointer referenced by this object.
 
T * get () const noexcept
 
bool isNull () const noexcept
 Returns true if this object refers to \nullptr.
 
void reset (T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
 Deletes the existing object it is pointing to (if any), and sets its pointer to other.
 

Protected Attributes

T * d
 

Friends

bool operator== (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs) noexcept
 Returns true if lhs and rhs refer to the same pointer.
 
bool operator!= (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs) noexcept
 Returns true if lhs and rhs refer to distinct pointers.
 
bool operator== (const QScopedPointer< T, Cleanup > &lhs, std::nullptr_t) noexcept
 
bool operator== (std::nullptr_t, const QScopedPointer< T, Cleanup > &rhs) noexcept
 
bool operator!= (const QScopedPointer< T, Cleanup > &lhs, std::nullptr_t) noexcept
 
bool operator!= (std::nullptr_t, const QScopedPointer< T, Cleanup > &rhs) noexcept
 

Detailed Description

template<typename T, typename Cleanup = QScopedPointerDeleter<T>>
class QScopedPointer< T, Cleanup >

\inmodule QtCore

The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon destruction.

Since
4.6 \reentrant

Managing heap allocated objects manually is hard and error prone, with the common result that code leaks memory and is hard to maintain. QScopedPointer is a small utility class that heavily simplifies this by assigning stack-based memory ownership to heap allocations, more generally called resource acquisition is initialization(RAII).

QScopedPointer guarantees that the object pointed to will get deleted when the current scope disappears.

Consider this function which does heap allocations, and has various exit points:

void myFunction(bool useSubClass)
{
MyClass *p = useSubClass ? new MyClass() : new MySubClass;
QIODevice *device = handsOverOwnership();
if (m_value > 3) {
delete p;
delete device;
return;
}
try {
process(device);
}
catch (...) {
delete p;
delete device;
throw;
}
delete p;
delete device;
}

It's encumbered by the manual delete calls. With QScopedPointer, the code can be simplified to:

void myFunction(bool useSubClass)
{
// assuming that MyClass has a virtual destructor
QScopedPointer<MyClass> p(useSubClass ? new MyClass() : new MySubClass);
QScopedPointer<QIODevice> device(handsOverOwnership());
if (m_value > 3)
return;
process(device);
}

The code the compiler generates for QScopedPointer is the same as when writing it manually. Code that makes use of delete are candidates for QScopedPointer usage (and if not, possibly another type of smart pointer such as QSharedPointer). QScopedPointer intentionally has no copy constructor or assignment operator, such that ownership and lifetime is clearly communicated.

The const qualification on a regular C++ pointer can also be expressed with a QScopedPointer:

const QWidget *const p = new QWidget();
// is equivalent to:
const QScopedPointer<const QWidget> p(new QWidget());
QWidget *const p = new QWidget();
// is equivalent to:
const QScopedPointer<QWidget> p(new QWidget());
const QWidget *p = new QWidget();
// is equivalent to:
QScopedPointer<const QWidget> p(new QWidget());

Definition at line 70 of file qscopedpointer.h.

Member Typedef Documentation

◆ pointer

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
QScopedPointer< T, Cleanup >::pointer

Definition at line 145 of file qscopedpointer.h.

Constructor & Destructor Documentation

◆ QScopedPointer()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > QScopedPointer< T, Cleanup >::QScopedPointer ( T * p = nullptr)
inlineexplicitnoexcept

Constructs this QScopedPointer instance and sets its pointer to p.

Definition at line 74 of file qscopedpointer.h.

◆ ~QScopedPointer()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > QScopedPointer< T, Cleanup >::~QScopedPointer ( )
inline

Destroys this QScopedPointer object.

Delete the object its pointer points to.

Definition at line 78 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d.

Member Function Documentation

◆ data()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > T * QScopedPointer< T, Cleanup >::data ( ) const
inlinenoexcept

Returns the value of the pointer referenced by this object.

QScopedPointer still owns the object pointed to.

Definition at line 105 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d.

Referenced by QAndroidActivityResultReceiver::QAndroidActivityResultReceiver(), QBsdKeyboardHandler::QBsdKeyboardHandler(), QBsdMouseHandler::QBsdMouseHandler(), QDirectFbBackingStore::QDirectFbBackingStore(), QDirectFbBlitter::QDirectFbBlitter(), QDirectFbBlitter::QDirectFbBlitter(), QDirectFbScreen::QDirectFbScreen(), QLibInputHandler::QLibInputHandler(), QPdfPageRenderer::QPdfPageRenderer(), QQmlPreviewServiceImpl::QQmlPreviewServiceImpl(), QQuickControlsTestUtils::QQuickControlsApplicationHelper::QQuickControlsApplicationHelper(), QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), QWaylandCompositorPrivate::QWaylandCompositorPrivate(), QWidgetPlatformColorDialog::QWidgetPlatformColorDialog(), QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(), QWidgetPlatformFontDialog::QWidgetPlatformFontDialog(), QWidgetPlatformMenu::QWidgetPlatformMenu(), QWidgetPlatformMenuItem::QWidgetPlatformMenuItem(), QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(), QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(), QXcbIntegration::QXcbIntegration(), VDMListDelegateDataType::VDMListDelegateDataType(), QAndroidActivityResultReceiver::~QAndroidActivityResultReceiver(), QDirectFbWindow::~QDirectFbWindow(), QGraphicsScenePrivate::_q_polishItems(), QWidgetPlatformMenuItem::action(), QQuickShapeGenericStrokeFillNode::activateMaterial(), QGraphicsScene::addItem(), QDirectFbInput::addWindow(), QDirectFbBlitter::alphaFillRect(), QBlittablePlatformPixmap::blittable(), QWasmMediaCaptureSession::camera(), QWasmCamera::cameraOutput(), QRasterPaintEnginePrivate::clip(), QStandardItemModelPrivate::columnsInserted(), QStandardItemModelPrivate::columnsRemoved(), QDtlsPrivateOpenSSL::continueHandshake(), QDirectFbWindowEGL::createDirectFBWindow(), QDirectFbWindow::createDirectFBWindow(), QDirectFbIntegration::createPlatformWindow(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollingSegments(), QScrollerPrivate::createScrollToSegments(), QDirectFbScreen::cursor(), QEglFSKmsGbmScreen::cursor(), QOffscreenScreen::cursor(), QWindowsScreen::cursor(), QDirectFbScreen::dfbLayer(), QDirectFbWindow::dfbSurface(), QDirectFbBlitter::dfbSurface(), QDirectFbConvenience::dfbSurfaceForPlatformPixmap(), QDirectFbWindow::dfbWindow(), QDirectFbBlitter::doLock(), QQmlTypeData::done(), QPrintDialog::done(), QDirectFbBlitter::doUnlock(), QCocoaIntegration::drag(), QDirectFbBlitter::drawCachedGlyphs(), QGraphicsScenePrivate::drawItemHelper(), QDirectFbBlitter::drawPixmapOpacity(), QOpenGLWindowPrivate::endPaint(), QOpenGLWidgetPaintDevice::ensureActiveTarget(), QEglFSKmsVsp2Screen::flip(), QDirectFbBackingStore::flush(), QWindowsDirect2DWindow::flush(), QBsdFbIntegration::fontDatabase(), QCocoaIntegration::fontDatabase(), QDirectFbIntegration::fontDatabase(), QEglFSIntegration::fontDatabase(), QIntegrityFbIntegration::fontDatabase(), QLinuxFbIntegration::fontDatabase(), QOffscreenIntegration::fontDatabase(), QVncIntegration::fontDatabase(), QXcbIntegration::fontDatabase(), QtWaylandClient::QWaylandIntegration::fontDatabase(), QScrollerPrivate::frameRateSkip(), BrcmEglIntegrationPrivate::get(), QGraphicsItemPrivate::get(), QGraphicsItemPrivate::get(), WaylandEglClientBufferIntegrationPrivate::get(), WaylandEglStreamClientBufferIntegrationPrivate::get(), QV4::ExecutionEngine::getPromiseReactionHandler(), QScrollerPrivate::handleDrag(), QPdfPageRendererPrivate::handleNextRequest(), QDtlsPrivateOpenSSL::handleTimeout(), QQuickSelectionRectanglePrivate::handleUnderPos(), QQmlIncubatorPrivate::incubate(), QHttpNetworkConnectionChannel::init(), QWaylandQuickItemPrivate::init(), QBsdFbIntegration::initialize(), QQmlTypeData::initializeFromCachedUnit(), QDirectFbIntegration::initializeInput(), VDMAbstractItemModelDataType::initializeMetaType(), QDirectFbIntegration::initializeScreen(), QAndroidPlatformIntegration::inputContext(), QBsdFbIntegration::inputContext(), QCocoaIntegration::inputContext(), QOffscreenIntegration::inputContext(), QWasmIntegration::inputContext(), QWindowsIntegration::inputContext(), QXcbIntegration::inputContext(), QtWaylandClient::QWaylandIntegration::inputContext(), QAbstractItemViewPrivate::isPersistent(), QStandardItemModelPrivate::itemFromIndex(), QtWaylandClient::QWaylandInputDevice::keyboard(), QCocoaIntegration::keyMapper(), QQmlPreviewHandler::loadUrl(), QDirectFbWindow::lower(), QGraphicsViewPrivate::mapToViewRect(), QWidgetPlatformMenu::menu(), QXcbClipboard::mimeData(), QScrollerPrivate::moveWhilePressed(), QBsdFbIntegration::nativeInterface(), QCocoaIntegration::nativeInterface(), QIntegrityFbIntegration::nativeInterface(), QOffscreenX11Integration::nativeInterface(), QVncIntegration::nativeInterface(), QXcbIntegration::nativeInterface(), QtWaylandClient::QWaylandIntegration::nativeInterface(), QPrintDialog::open(), QScrollerProperties::operator!=(), QScrollerProperties::operator=(), QScrollerProperties::operator==(), QPrintDialog::options(), QBackingStore::paintDevice(), QDirectFbBackingStore::paintDevice(), QBlittablePlatformPixmap::paintEngine(), QGraphicsView::paintEvent(), QCocoaClipboard::pasteboardForMode(), QWindowsDirect2DWindow::pixmap(), QtWaylandClient::QWaylandInputDevice::pointer(), QScrollerPrivate::pressWhileInactive(), QGraphicsScenePrivate::processDirtyItemsRecursive(), QDirectFbWindow::raise(), QPdfBookmarkModelPrivate::rebuild(), QtWaylandClient::QWaylandIntegration::reconfigureInputContext(), PressDelayHandler::released(), QScrollerPrivate::releaseWhileDragging(), QDirectFbInput::removeWindow(), QNetworkReplyHttpImplPrivate::replySslConfigurationChanged(), QWindowsBackingStore::resize(), QDirectFbBackingStore::resize(), QBsdKeyboardHandler::revertTTYSettings(), QStandardItemModelPrivate::rowsInserted(), QStandardItemModelPrivate::rowsRemoved(), QDirectFbInput::run(), QGraphicsItem::sceneBoundingRect(), QGraphicsItemPrivate::sceneEffectiveBoundingRect(), QBsdFbIntegration::screens(), QDirectFbBackingStore::scroll(), QBsdFbIntegration::services(), QCocoaIntegration::services(), QDirectFbIntegration::services(), QEglFSIntegration::services(), QIntegrityFbIntegration::services(), QLinuxFbIntegration::services(), QOffscreenIntegration::services(), QVncIntegration::services(), QXcbIntegration::services(), QWasmMediaCaptureSession::setCamera(), QScrollerPrivate::setContentPositionHelperDragging(), QDirectFbWindow::setGeometry(), QGraphicsTransformPrivate::setItem(), QDirectFbWindow::setKeyboardGrabEnabled(), QEglFSKmsVsp2Screen::setLayerBuffer(), QDirectFbWindow::setMouseGrabEnabled(), QDirectFbWindow::setOpacity(), QPrintDialog::setOption(), QPrintDialog::setOptions(), QHttpNetworkConnectionChannel::setSslConfiguration(), QDirectFbWindow::setVisible(), QDirectFbWindow::setWindowFlags(), QWidgetPlatformColorDialog::show(), QWidgetPlatformFileDialog::show(), QWidgetPlatformMessageDialog::show(), QWidgetPlatformFontDialog::show(), QTreeModel::sortItems(), QDirectFbTextureGlyphCache::sourceSurface(), QHttpThreadDelegate::startRequest(), QQmlPreviewServiceImpl::stateChanged(), QWindowsIntegration::staticOpenGLContext(), QDirectFbInput::stopInputEventLoop(), QGraphicsGridLayoutPrivate::styleInfo(), QGraphicsLinearLayoutPrivate::styleInfo(), QQuickContext2D::surface(), QPrintDialog::testOption(), PressDelayHandler::timerEvent(), QDirectFbBackingStore::toImage(), QWindowsBackingStore::toImage(), QtWaylandClient::QWaylandInputDevice::touch(), QGraphicsItemPrivate::updateAncestorFlags(), QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively(), QScrollerPrivate::updateVelocity(), QDirectFbWindow::winId(), QOffscreenX11Connection::x11Info(), and QWaylandTextInputV3Private::zwp_text_input_v3_commit().

◆ get()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > T * QScopedPointer< T, Cleanup >::get ( ) const
inlinenoexcept

◆ isNull()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::isNull ( ) const
inlinenoexcept

◆ operator bool()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > QScopedPointer< T, Cleanup >::operator bool ( ) const
inlineexplicit

Returns true if the contained pointer is not \nullptr.

This function is suitable for use in \tt if-constructs, like:

if (scopedPointer) {
...
}
See also
isNull()

Definition at line 100 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::isNull().

+ Here is the call graph for this function:

◆ operator!()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator! ( ) const
inlinenoexcept

Returns true if this object refers to \nullptr.

See also
isNull()

Definition at line 95 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d.

◆ operator*()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > T & QScopedPointer< T, Cleanup >::operator* ( ) const
inline

Provides access to the scoped pointer's object.

If the contained pointer is \nullptr, behavior is undefined.

See also
isNull()

Definition at line 84 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d, and Q_ASSERT.

◆ operator->()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > T * QScopedPointer< T, Cleanup >::operator-> ( ) const
inlinenoexcept

Provides access to the scoped pointer's object.

If the contained pointer is \nullptr, behavior is undefined.

See also
isNull()

Definition at line 90 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d.

◆ reset()

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > void QScopedPointer< T, Cleanup >::reset ( T * other = nullptr)
inlinenoexcept

Deletes the existing object it is pointing to (if any), and sets its pointer to other.

QScopedPointer now owns other and will delete it in its destructor.

Definition at line 120 of file qscopedpointer.h.

References QScopedPointer< T, Cleanup >::d, and other().

Referenced by QBsdFbIntegration::QBsdFbIntegration(), QBsdKeyboardHandler::QBsdKeyboardHandler(), QBsdMouseHandler::QBsdMouseHandler(), QCocoaIntegration::QCocoaIntegration(), QCtfLibImpl::QCtfLibImpl(), QDirectFbBackingStore::QDirectFbBackingStore(), QDirectFBCursor::QDirectFBCursor(), QDirectFbScreen::QDirectFbScreen(), QFbCursor::QFbCursor(), QGraphicsFrameCapture::QGraphicsFrameCapture(), QGtk3ColorDialogHelper::QGtk3ColorDialogHelper(), QGtk3FileDialogHelper::QGtk3FileDialogHelper(), QGtk3FontDialogHelper::QGtk3FontDialogHelper(), QLibInputHandler::QLibInputHandler(), QNmeaSatelliteSimulationReader::QNmeaSatelliteSimulationReader(), QOffscreenIntegration::QOffscreenIntegration(), QPrinterInfo::QPrinterInfo(), QQmlFileSelectorPrivate::QQmlFileSelectorPrivate(), QQmlPreviewHandler::QQmlPreviewHandler(), QQmlPreviewServiceImpl::QQmlPreviewServiceImpl(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QWaylandCompositorPrivate::QWaylandCompositorPrivate(), QXcbIntegration::QXcbIntegration(), VDMListDelegateDataType::VDMListDelegateDataType(), QOpenGLWindowPrivate::~QOpenGLWindowPrivate(), QWasmMediaRecorder::~QWasmMediaRecorder(), QQuickShapeGenericStrokeFillNode::activateMaterial(), QFSFileEngineIterator::advance(), QBackingStore::beginPaint(), QOpenGLWindowPrivate::beginPaint(), QQuickSwipePrivate::beginTransition(), QQuickDelayButtonPrivate::beginTransition(), QBlittablePlatformPixmap::blittable(), QOpenGLTextureBlitterPrivate::buildProgram(), QQmlIncubatorPrivate::clear(), QDtlsPrivateOpenSSL::continueHandshake(), QCompletionModel::createEngine(), VDMListDelegateDataType::createProperty(), QQmlDMObjectDataMetaObject::createProperty(), QFileDialogPrivate::createWidgets(), QEglFSKmsGbmScreen::cursor(), QWasmVideoOutput::doElementCallbacks(), QQmlTypeData::done(), QBsdFbScreen::doRedraw(), QSGSoftwareRenderThread::event(), QBlittablePlatformPixmap::fill(), QXcbClipboard::handleXFixesSelectionRequest(), QWaylandQuickItemPrivate::init(), QJSValueIteratorPrivate::init(), QQuickWindowPrivate::init(), QOpenGLWindowPrivate::initialize(), QNmeaSatelliteInfoSourcePrivate::initialize(), QAndroidPlatformIntegration::initialize(), QBsdFbIntegration::initialize(), QEglFSIntegration::initialize(), QIntegrityFbIntegration::initialize(), QLinuxFbIntegration::initialize(), QOffscreenIntegration::initialize(), QVncIntegration::initialize(), QWasmIntegration::initialize(), QWindowsIntegration::initialize(), QXcbIntegration::initialize(), QXcbEglIntegration::initialize(), QXcbGlxIntegration::initialize(), QDirectFbIntegration::initializeDirectFB(), QQmlTypeData::initializeFromCachedUnit(), LinuxDmabufClientBufferIntegration::initializeHardware(), QDirectFbIntegration::initializeInput(), VDMAbstractItemModelDataType::initializeMetaType(), VDMObjectDelegateDataType::initializeMetaType(), QDirectFbIntegration::initializeScreen(), QEglFSKmsVsp2Screen::initVsp2(), QSGRenderThread::invalidateGraphics(), QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), QPdfDocumentPrivate::load(), QQmlPreviewHandler::loadUrl(), QXcbClipboard::mimeData(), QMinimalIntegration::nativeInterface(), QOffscreenIntegration::nativeInterface(), QOffscreenX11Integration::nativeInterface(), QOffscreenX11PlatformNativeInterface::nativeResourceForScreen(), QV4::ExecutionEngine::newPromiseObject(), QV4::ExecutionEngine::newPromiseObject(), QPrinterInfo::operator=(), QBlittablePlatformPixmap::paintEngine(), QNetworkReplyHttpImplPrivate::postRequest(), PressDelayHandler::pressed(), QtWaylandClient::QWaylandIntegration::reconfigureInputContext(), PressDelayHandler::released(), QNetworkReplyHttpImplPrivate::replySslConfigurationChanged(), QWindowsBackingStore::resize(), QBlittablePlatformPixmap::resize(), QWindowsDirect2DWindow::resizeSwapChain(), QDirectFbTextureGlyphCache::resizeTextureData(), QWindowsDirect2DPaintEngineSuspender::resume(), QBsdKeyboardHandler::revertTTYSettings(), PressDelayHandler::scrollerBecameActive(), PressDelayHandler::scrollerWasIntercepted(), QtWaylandClient::QWaylandInputDevice::seat_capabilities(), QBlittablePlatformPixmap::setBlittable(), QWasmMediaCaptureSession::setCamera(), QWaylandSeatPrivate::setCapabilities(), QQuickImageParticle::setColortable(), QQuickImageParticle::setImage(), QQuickImageParticle::setOpacitytable(), QQuickImageParticle::setSizetable(), QHttpNetworkConnectionChannel::setSslConfiguration(), QQuickTextPrivate::setupCustomLineGeometry(), QQuickTextPrivate::setupTextLayout(), QQmlPreviewServiceImpl::stateChanged(), QGraphicsGridLayoutPrivate::styleInfo(), QGraphicsLinearLayoutPrivate::styleInfo(), PressDelayHandler::timerEvent(), QQuickSelectionRectanglePrivate::updateHandles(), QSGVivanteVideoMaterialShader::updateSampledImage(), QOffscreenX11Connection::x11Info(), QWaylandTextInputV3Private::zwp_text_input_v3_commit(), QWaylandTextInputV3Private::zwp_text_input_v3_disable(), and QWaylandTextInputV3Private::zwp_text_input_v3_enable().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!= [1/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator!= ( const QScopedPointer< T, Cleanup > & lhs,
const QScopedPointer< T, Cleanup > & rhs )
friend

Returns true if lhs and rhs refer to distinct pointers.

Definition at line 152 of file qscopedpointer.h.

◆ operator!= [2/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator!= ( const QScopedPointer< T, Cleanup > & lhs,
std::nullptr_t  )
friend
Since
5.8

Returns true if lhs refers to a valid (i.e. non-null) pointer.

See also
QScopedPointer::isNull()

Definition at line 167 of file qscopedpointer.h.

◆ operator!= [3/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator!= ( std::nullptr_t ,
const QScopedPointer< T, Cleanup > & rhs )
friend
Since
5.8

Returns true if rhs refers to a valid (i.e. non-null) pointer.

See also
QScopedPointer::isNull()

Definition at line 172 of file qscopedpointer.h.

◆ operator== [1/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator== ( const QScopedPointer< T, Cleanup > & lhs,
const QScopedPointer< T, Cleanup > & rhs )
friend

Returns true if lhs and rhs refer to the same pointer.

Definition at line 147 of file qscopedpointer.h.

◆ operator== [2/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator== ( const QScopedPointer< T, Cleanup > & lhs,
std::nullptr_t  )
friend
Since
5.8

Returns true if lhs refers to \nullptr.

See also
QScopedPointer::isNull()

Definition at line 157 of file qscopedpointer.h.

◆ operator== [3/3]

template<typename T , typename Cleanup = QScopedPointerDeleter<T>>
template< typename T, typename Cleanup > bool QScopedPointer< T, Cleanup >::operator== ( std::nullptr_t ,
const QScopedPointer< T, Cleanup > & rhs )
friend
Since
5.8

Returns true if rhs refers to \nullptr.

See also
QScopedPointer::isNull()

Definition at line 162 of file qscopedpointer.h.

Member Data Documentation

◆ d


The documentation for this class was generated from the following files: