PythonQt
PythonQtNewOwnerOfThis< T > Class Template Reference

#include <PythonQt.h>

Public Member Functions

 PythonQtNewOwnerOfThis (const T &t)
 Allow conversion from T to PythonQtNewOwnerOfThis<T>.
 operator T () const
 Allow conversion from PythonQtNewOwnerOfThis<T> to T.

Public Attributes

T _t

Detailed Description

template<class T>
class PythonQtNewOwnerOfThis< T >

Helper template that allows to pass the ownership of a C++ instance between C++ and Python (it is used as a slot return type or parameter type so that it can be detected by the PythonQt slot calling code).

Definition at line 130 of file PythonQt.h.

Constructor & Destructor Documentation

◆ PythonQtNewOwnerOfThis()

template<class T>
PythonQtNewOwnerOfThis< T >::PythonQtNewOwnerOfThis ( const T & t)
inline

Allow conversion from T to PythonQtNewOwnerOfThis<T>.

Definition at line 134 of file PythonQt.h.

References _t.

Member Function Documentation

◆ operator T()

template<class T>
PythonQtNewOwnerOfThis< T >::operator T ( ) const
inline

Allow conversion from PythonQtNewOwnerOfThis<T> to T.

Definition at line 139 of file PythonQt.h.

139{ return _t; }

References _t.

Member Data Documentation

◆ _t

template<class T>
T PythonQtNewOwnerOfThis< T >::_t

Stored value. This is important so that it has the same memory layout as a pointer if T is a pointer type (which is the typical use case for this class).

Definition at line 143 of file PythonQt.h.

Referenced by operator T(), and PythonQtNewOwnerOfThis().


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