FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Related Functions | List of all members
qtcore::QObjectWrap< T > Class Template Reference

#include <qttools/core/qobject_wrap.h>

Inheritance diagram for qtcore::QObjectWrap< T >:

Public Member Functions

 QObjectWrap (const T &value, QObject *parent=nullptr)
 
 QObjectWrap (T &&value, QObject *parent=nullptr)
 
const T & value () const
 
void setValue (const T &val)
 
void setValue (T &&val)
 

Related Functions

(Note that these are not member functions.)

template<typename T >
QObjectWrap< T > * wrapAsQObject (const T &value, QObject *parent=nullptr)
 

Detailed Description

template<typename T>
class qtcore::QObjectWrap< T >

Wraps (adapts) any class object into a QObject instance

This class is useful to let Qt handle the lifecycle of a non QObject : wrap an instance to a QObject and then let its parent takes ownership

Constructor & Destructor Documentation

template<typename T >
qtcore::QObjectWrap< T >::QObjectWrap ( const T &  value,
QObject *  parent = nullptr 
)
template<typename T >
qtcore::QObjectWrap< T >::QObjectWrap ( T &&  value,
QObject *  parent = nullptr 
)

Member Function Documentation

template<typename T >
void qtcore::QObjectWrap< T >::setValue ( const T &  val)
template<typename T >
void qtcore::QObjectWrap< T >::setValue ( T &&  val)
template<typename T >
const T & qtcore::QObjectWrap< T >::value ( ) const

Friends And Related Function Documentation

template<typename T >
QObjectWrap< T > * wrapAsQObject ( const T &  value,
QObject *  parent = nullptr 
)
related

Create a QObjectWrap<T> owning value

This is equivalent to qtcore::QObjectWrap<T>(value, parent), but usually requires less typing


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