- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# QPointer< T > Class Template Reference

Search for all occurrences

## Detailed Description

### template<class T>
class QPointer< T >

Definition at line 54 of file qpointer.h.

`#include <qpointer.h>`

List of all members.

## Public Member Functions
| QPointer ()
| QPointer (T *p)
| QPointer (const QPointer< T > &p)
| ~QPointer ()
QPointer< T > & | operator= (const QPointer< T > &p)
QPointer< T > & | operator= (T *p)
bool | isNull () const
T * | operator-> () const
T & | operator* () const
| operator T * () const
T * | data () const

## Constructor & Destructor Documentation

QPointer | ( |  | ) | `[inline]`

Definition at line 58 of file qpointer.h.

    : o(0) {}

QPointer | ( | T * | p | ) | `[inline]`

Definition at line 59 of file qpointer.h.

                              : o(p)
            { QMetaObject::addGuard(&o); }

QPointer | ( | const QPointer< T > & | p | ) | `[inline]`

Definition at line 61 of file qpointer.h.

                                              : o(p.o)
            { QMetaObject::addGuard(&o); }

~QPointer | ( |  | ) | `[inline]`

Definition at line 63 of file qpointer.h.

            { QMetaObject::removeGuard(&o); }

## Member Function Documentation

QPointer<T>& operator= | ( | const QPointer< T > & | p | ) | `[inline]`

Definition at line 65 of file qpointer.h.

            { if (this != &p) QMetaObject::changeGuard(&o, p.o); return *this; }

QPointer<T>& operator= | ( | T * | p | ) | `[inline]`

Definition at line 67 of file qpointer.h.

            { if (o != p) QMetaObject::changeGuard(&o, p); return *this; }

bool isNull | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 70 of file qpointer.h.

            { return !o; }

T* operator-> | ( | void |  | ) | const `[inline]`

Definition at line 73 of file qpointer.h.

            { return static_cast<T*>(const_cast<QObject*>(o)); }

T& operator* | ( |  | ) | const `[inline]`

Definition at line 75 of file qpointer.h.

            { return *static_cast<T*>(const_cast<QObject*>(o)); }

operator T * | ( |  | ) | const `[inline]`

Definition at line 77 of file qpointer.h.

            { return static_cast<T*>(const_cast<QObject*>(o)); }

T* data | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 79 of file qpointer.h.

            { return static_cast<T*>(const_cast<QObject*>(o)); }

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

- QtCore/qpointer.h