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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# QSharedPointer< T > Class Template Reference

Search for all occurrences

## Detailed Description

### template<class T>
class QSharedPointer< T >

Definition at line 444 of file qsharedpointer_impl.h.

`#include <qsharedpointer_impl.h>`

Inheritance diagram for QSharedPointer< T >:
[legend]

List of all members.

## Public Member Functions
| QSharedPointer ()
| QSharedPointer (T *ptr)
template<typename Deleter >
| QSharedPointer (T *ptr, Deleter d)
| QSharedPointer (const QSharedPointer< T > &other)
QSharedPointer< T > & | operator= (const QSharedPointer< T > &other)
template<class X >
| QSharedPointer (const QSharedPointer< X > &other)
template<class X >
QSharedPointer< T > & | operator= (const QSharedPointer< X > &other)
template<class X >
| QSharedPointer (const QWeakPointer< X > &other)
template<class X >
QSharedPointer< T > & | operator= (const QWeakPointer< X > &other)
void | swap (QSharedPointer &other)
template<class X >
QSharedPointer< X > | staticCast () const
template<class X >
QSharedPointer< X > | dynamicCast () const
template<class X >
QSharedPointer< X > | constCast () const
template<class X >
QSharedPointer< X > | objectCast () const
void | clear ()
QWeakPointer< T > | toWeakRef () const
## Static Public Member Functions
static QSharedPointer< T > | create ()
## Protected Member Functions
| QSharedPointer (Qt::Initialization i)

## Constructor & Destructor Documentation

QSharedPointer | ( |  | ) | `[inline]`

Definition at line 448 of file qsharedpointer_impl.h.

    { }

QSharedPointer | ( | T * | ptr | ) | `[inline, explicit]`

Definition at line 451 of file qsharedpointer_impl.h.

                                               : BaseClass(Qt::Uninitialized)
        { BaseClass::internalConstruct(ptr); }

QSharedPointer | ( | T * | ptr,
|  | Deleter | d
| ) |  | `[inline]`

Definition at line 455 of file qsharedpointer_impl.h.

    { BaseClass::internalConstruct(ptr, d); }

QSharedPointer | ( | const QSharedPointer< T > & | other | ) | `[inline]`

Definition at line 457 of file qsharedpointer_impl.h.

    : BaseClass(other) { }

QSharedPointer | ( | const QSharedPointer< X > & | other | ) | `[inline]`

Definition at line 465 of file qsharedpointer_impl.h.

                                                              : BaseClass(other)
        { }

QSharedPointer | ( | const QWeakPointer< X > & | other | ) | `[inline]`

Definition at line 477 of file qsharedpointer_impl.h.

                                                            : BaseClass(Qt::Uninitialized)
        { this->d = 0; *this = other; }

QSharedPointer | ( | Qt::Initialization | i | ) | `[inline, explicit, protected]`

Definition at line 518 of file qsharedpointer_impl.h.

    : BaseClass(i) {}

## Member Function Documentation

QSharedPointer<T>& operator= | ( | const QSharedPointer< T > & | other | ) | `[inline]`

Definition at line 458 of file qsharedpointer_impl.h.

        {
            BaseClass::internalCopy(other);
            return *this;
        }

QSharedPointer<T>& operator= | ( | const QSharedPointer< X > & | other | ) | `[inline]`

Definition at line 469 of file qsharedpointer_impl.h.

        {
            QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid
            BaseClass::internalCopy(other);
            return *this;
        }

QSharedPointer<T>& operator= | ( | const QWeakPointer< X > & | other | ) | `[inline]`

Definition at line 481 of file qsharedpointer_impl.h.

        { BaseClass::internalSet(other.d, other.value); return *this; }

void swap | ( | QSharedPointer< T > & | other | ) | `[inline]`

Search for all occurrences

Definition at line 484 of file qsharedpointer_impl.h.

        { QSharedPointer<T>::internalSwap(other); }

QSharedPointer<X> staticCast | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 488 of file qsharedpointer_impl.h.

        {
            return qSharedPointerCast<X, T>(*this);
        }

QSharedPointer<X> dynamicCast | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 494 of file qsharedpointer_impl.h.

        {
            return qSharedPointerDynamicCast<X, T>(*this);
        }

QSharedPointer<X> constCast | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 500 of file qsharedpointer_impl.h.

        {
            return qSharedPointerConstCast<X, T>(*this);
        }

QSharedPointer<X> objectCast | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 507 of file qsharedpointer_impl.h.

        {
            return qSharedPointerObjectCast<X, T>(*this);
        }

void clear | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 513 of file qsharedpointer_impl.h.

    { *this = QSharedPointer<T>(); }

Q_INLINE_TEMPLATE QWeakPointer< T > toWeakRef | ( |  | ) | const

Search for all occurrences

Definition at line 756 of file qsharedpointer_impl.h.

    {
        return QWeakPointer<T>(*this);
    }

static QSharedPointer<T> create | ( |  | ) | `[inline, static]`

Search for all occurrences

Definition at line 521 of file qsharedpointer_impl.h.

        {
            QSharedPointer<T> result(Qt::Uninitialized);
            result.internalCreate();

            // now initialize the data
            new (result.data()) T();
            result.internalFinishConstruction(result.data());
            return result;
        }

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

- QtCore/qsharedpointer_impl.h