OpendTect-6_4  6.4
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
i_LayoutMngr Class Reference

dGB's layout manager More...

Inheritance diagram for i_LayoutMngr:
[legend]

Public Member Functions

 i_LayoutMngr (mQtclass(QWidget *) prnt, const char *name, uiObjectBody &mngbdy)
 
virtual ~i_LayoutMngr ()
 
virtual void addItem (mQtclass(QLayoutItem *))
 
void addItem (i_LayoutItem *)
 
virtual mQtclass (QSize) sizeHint() const
 
virtual mQtclass (QSize) minimumSize() const
 
virtual mQtclass (QLayoutItem *) itemAt(int idx) const
 
virtual mQtclass (QLayoutItem *) takeAt(int idx)
 
virtual int count () const
 
virtual void invalidate ()
 
virtual void updatedAlignment (LayoutMode)
 
virtual void initChildLayout (LayoutMode)
 
bool attach (constraintType, mQtclass(QWidget &), mQtclass(QWidget *), int, bool reciprocal=true)
 
const uiRectcurpos (LayoutMode) const
 
uiRectcurpos (LayoutMode)
 
uiRect winpos (LayoutMode) const
 
void forceChildrenRedraw (uiObjectBody *, bool deep)
 
void childrenClear (uiObject *)
 
bool isChild (uiObject *)
 
int childStretch (bool hor) const
 
int borderSpace () const
 
int horSpacing () const
 
int verSpacing () const
 
void setHSpacing (int s)
 
void setVSpacing (int s)
 
void setBorderSpace (int s)
 
void setIsMain (bool yn)
 
void layoutChildren (LayoutMode, bool finalLoop=false)
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Private Member Functions

void setGeometry (const mQtclass(QRect &))
 
void doLayout (LayoutMode m, const mQtclass(QRect &) r) const
 
void doLayout (LayoutMode m, const mQtclass(QRect &))
 
void itemDel (CallBacker *)
 
void moveChildrenTo (int, int, LayoutMode)
 
void fillResizeList (ObjectSet< resizeItem > &, bool)
 
bool tryToGrowItem (resizeItem &, const int, const int, int, int, const mQtclass(QRect &), int)
 
void resizeTo (const mQtclass(QRect &))
 
void childrenCommitGeometrySet (bool)
 
uiRect childrenRect (LayoutMode)
 
 mQtclass (QRect) prefGeometry
 
void startPoptimer ()
 
void popTimTick (CallBacker *)
 

Private Attributes

ObjectSet< i_LayoutItemchildrenlist
 
uiRect layoutpos [nLayoutMode]
 
bool minimumDone
 
bool preferredDone
 
bool prefposStored
 
bool ismain
 
int hspacing
 
int vspacing
 
int borderspc
 
uiObjectBody & managedBody
 
Timerpoptimer
 
bool popped_up
 
bool timer_running
 

Friends

class i_LayoutItem
 
class uiGroupParentBody
 

Additional Inherited Members

- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Detailed Description

dGB's layout manager

This is our own layout manager for Qt. It manages widgets, etc. using constraints like "rightOf" etc.

Because the i_LayoutMngr is a QLayout, it can be used by QWidgets to automatically add new children to the manager when they are constructed with a QWidget (with layout) as parent.

The actual adding to a manager is is done using QEvents. Whenever a QObject inserts a new child, it posts a ChildInserted event to itself. However, a QLayout constructor installs an event filter on its parent, and it registers itself to the parent as its layouter (setWidgetLayout), so future calls to the parent's sizeHint(), etc. are redirected to this new layoutmanager.

If setAutoAdd() is called on a layoutmanager, and the layout manager is "topLevel", i.e. THE manager for a certain widget, then whenever a new widget is constructed with the manager's parent widget as parent, the new widget is automatically added (by Qt) to the manager by the manager's eventfilter, using 'addItem( new QWidgetItem( w ) )'. Unfortunately, Qt does not call addItem before the main application loop is running. This results to the problem that no attachments can be used until the main loop is running when we let Qt handle the addItem() calls. Therefore, we explicitily call addItem() on the correct layout manager at construction uiObjects. AutoAdd is also enabled in case someone wants to eses native Qt methods. (Multiple insertion is protected. Manager checks if widget already present).

Constructor & Destructor Documentation

i_LayoutMngr::i_LayoutMngr ( mQtclass(QWidget *)  prnt,
const char *  name,
uiObjectBody &  mngbdy 
)
virtual i_LayoutMngr::~i_LayoutMngr ( )
virtual

Member Function Documentation

virtual void i_LayoutMngr::addItem ( mQtclass(QLayoutItem *)  )
virtual
void i_LayoutMngr::addItem ( i_LayoutItem )
bool i_LayoutMngr::attach ( constraintType  ,
mQtclass(QWidget &)  ,
mQtclass(QWidget *)  ,
int  ,
bool  reciprocal = true 
)
int i_LayoutMngr::borderSpace ( ) const
inline
void i_LayoutMngr::childrenClear ( uiObject )
void i_LayoutMngr::childrenCommitGeometrySet ( bool  )
private
uiRect i_LayoutMngr::childrenRect ( LayoutMode  )
private
int i_LayoutMngr::childStretch ( bool  hor) const
virtual int i_LayoutMngr::count ( ) const
virtual
const uiRect& i_LayoutMngr::curpos ( LayoutMode  ) const
uiRect& i_LayoutMngr::curpos ( LayoutMode  )
void i_LayoutMngr::doLayout ( LayoutMode  m,
const mQtclass(QRect &)  r 
) const
inlineprivate
void i_LayoutMngr::doLayout ( LayoutMode  m,
const   mQtclassQRect & 
)
private
void i_LayoutMngr::fillResizeList ( ObjectSet< resizeItem > &  ,
bool   
)
private
void i_LayoutMngr::forceChildrenRedraw ( uiObjectBody *  ,
bool  deep 
)
int i_LayoutMngr::horSpacing ( ) const
virtual void i_LayoutMngr::initChildLayout ( LayoutMode  )
virtual
virtual void i_LayoutMngr::invalidate ( )
virtual
bool i_LayoutMngr::isChild ( uiObject )
void i_LayoutMngr::itemDel ( CallBacker )
private
void i_LayoutMngr::layoutChildren ( LayoutMode  ,
bool  finalLoop = false 
)
void i_LayoutMngr::moveChildrenTo ( int  ,
int  ,
LayoutMode   
)
private
virtual i_LayoutMngr::mQtclass ( QSize  ) const
virtual
virtual i_LayoutMngr::mQtclass ( QSize  ) const
virtual
virtual i_LayoutMngr::mQtclass ( QLayoutItem *  ) const
virtual
virtual i_LayoutMngr::mQtclass ( QLayoutItem *  )
virtual
i_LayoutMngr::mQtclass ( QRect  )
private
void i_LayoutMngr::popTimTick ( CallBacker )
private
void i_LayoutMngr::resizeTo ( const   mQtclassQRect &)
private
void i_LayoutMngr::setBorderSpace ( int  s)
inline
void i_LayoutMngr::setGeometry ( const   mQtclassQRect &)
private
void i_LayoutMngr::setHSpacing ( int  s)
inline
void i_LayoutMngr::setIsMain ( bool  yn)
inline
void i_LayoutMngr::setVSpacing ( int  s)
inline
void i_LayoutMngr::startPoptimer ( )
private
bool i_LayoutMngr::tryToGrowItem ( resizeItem &  ,
const int  ,
const int  ,
int  ,
int  ,
const   mQtclassQRect &,
int   
)
private
virtual void i_LayoutMngr::updatedAlignment ( LayoutMode  )
virtual
int i_LayoutMngr::verSpacing ( ) const
inline
uiRect i_LayoutMngr::winpos ( LayoutMode  ) const

Friends And Related Function Documentation

friend class i_LayoutItem
friend
friend class uiGroupParentBody
friend

Member Data Documentation

int i_LayoutMngr::borderspc
private
ObjectSet<i_LayoutItem> i_LayoutMngr::childrenlist
private
int i_LayoutMngr::hspacing
private
bool i_LayoutMngr::ismain
private
uiRect i_LayoutMngr::layoutpos[nLayoutMode]
private
uiObjectBody& i_LayoutMngr::managedBody
private
bool i_LayoutMngr::minimumDone
private
bool i_LayoutMngr::popped_up
private
Timer& i_LayoutMngr::poptimer
private
bool i_LayoutMngr::preferredDone
private
bool i_LayoutMngr::prefposStored
private
bool i_LayoutMngr::timer_running
private
int i_LayoutMngr::vspacing
private

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