OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
uiObjBodyImpl< C, T > Class Template Reference

Default (Template) implementation of uiObjectBody. More...

Inheritance diagram for uiObjBodyImpl< C, T >:
[legend]

Public Member Functions

 uiObjBodyImpl (C &hndle, uiParent *parnt, const char *nm)
 
virtual const QWidget * qwidget_ () const
 
virtual void setFont (const QFont &)
 override Qt More...
 
virtual void fontChange (const QFont &oldFont)
 
virtual void closeEvent (QCloseEvent *e)
 override Qt More...
 

Protected Member Functions

virtual uiObjectuiObjHandle ()
 
C & handle ()
 

Protected Attributes

C & handle_
 

Detailed Description

template<class C, class T>
class uiObjBodyImpl< C, T >

Default (Template) implementation of uiObjectBody.

Any uiObjectBody must implement thiswidget_() and uiObjHandle() and must also implement some QWidget methods. These are implemented using the pre-processor, because it is difficult to templatize for all cases since some Qt objects need a specific constructor. However, most QWidgets just need a parent and a name and then this template implementation can be used.

#define mHANDLE_OBJ uiObject_or_child_class, default O
#define mQWIDGET_BODY Widget_or_child_class, default T
#define mQWIDGET_BASE QWidget
#include "i_uiobjqtbody.h"

The macro's mQWIDGET_BODY and mQWIDGET_BASE are undef'ed in "i_uiobjqtbody.h"

The "i_uiobjqtbody.h" header file uses no multiple-inclusion protection and implements the following methods:

virtual QWidget* qwidget_();
virtual void setFont( const QFont &font );
virtual void closeEvent( QCloseEvent *e );
virtual void polish();
protected:
virtual uiObject& uiObjHandle();

It also declares a protected member handle_, of type mHANDLE_OBJ&, which must be initialized in any constructor of objects using "i_uiobjqtbody.h"

Constructor & Destructor Documentation

template<class C , class T >
uiObjBodyImpl< C, T >::uiObjBodyImpl ( C &  hndle,
uiParent parnt,
const char *  nm 
)
inline

Member Function Documentation

template<class C , class T >
virtual void uiObjBodyImpl< C, T >::closeEvent ( QCloseEvent *  e)
inlinevirtual

override Qt

template<class C , class T >
virtual void uiObjBodyImpl< C, T >::fontChange ( const QFont &  oldFont)
inlinevirtual
template<class C , class T >
C& uiObjBodyImpl< C, T >::handle ( )
inlineprotected
template<class C , class T >
virtual const QWidget* uiObjBodyImpl< C, T >::qwidget_ ( ) const
inlinevirtual
template<class C , class T >
virtual void uiObjBodyImpl< C, T >::setFont ( const QFont &  )
inlinevirtual

override Qt

template<class C , class T >
virtual uiObject& uiObjBodyImpl< C, T >::uiObjHandle ( )
inlineprotectedvirtual

Member Data Documentation

template<class C , class T >
C& uiObjBodyImpl< C, T >::handle_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019