OpendTect  6.6
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 (QWidget *prnt, const char *name, uiObjectBody &mngbdy)
 
virtual ~i_LayoutMngr ()
 
void addItem (i_LayoutItem *)
 
virtual void addItem (QLayoutItem *)
 
bool attach (constraintType, QWidget &, QWidget *, int, bool reciprocal=true)
 
int borderSpace () const
 
void childrenClear (uiObject *)
 
int childStretch (bool hor) const
 
virtual int count () const
 
uiRectcurpos (LayoutMode)
 
const uiRectcurpos (LayoutMode) const
 
void forceChildrenRedraw (uiObjectBody *, bool deep)
 
int horSpacing () const
 
virtual void initChildLayout (LayoutMode)
 
virtual void invalidate ()
 
bool isChild (uiObject *)
 
virtual QLayoutItem * itemAt (int idx) const
 
void layoutChildren (LayoutMode, bool finalLoop=false)
 
virtual QSize minimumSize () const
 
void setBorderSpace (int s)
 
void setHSpacing (int s)
 
void setIsMain (bool yn)
 
void setVSpacing (int s)
 
virtual QSize sizeHint () const
 
virtual QLayoutItem * takeAt (int idx)
 
virtual void updatedAlignment (LayoutMode)
 
int verSpacing () const
 
uiRect winpos (LayoutMode) const
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
virtual const name_typename () const
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 

Private Member Functions

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

Private Attributes

int borderspc_
 
ObjectSet< i_LayoutItemchildrenlist_
 
int hspacing_
 
bool ismain_
 
uiRect layoutpos_ [nLayoutMode]
 
uiObjectBodymanagedbody_
 
bool minimumdone_
 
bool poppedup_
 
Timerpoptimer_
 
bool preferreddone_
 
QRect prefgeometry_
 
bool prefposstored_
 
bool timerrunning_
 
int vspacing_
 

Friends

class i_LayoutItem
 
class uiGroupParentBody
 

Additional Inherited Members

- Public Types inherited from ObjectWithName
typedef OD::String name_type
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

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::i_LayoutMngr ( QWidget *  prnt,
const char *  name,
uiObjectBody mngbdy 
)

◆ ~i_LayoutMngr()

virtual i_LayoutMngr::~i_LayoutMngr ( )
virtual

Member Function Documentation

◆ addItem() [1/2]

void i_LayoutMngr::addItem ( i_LayoutItem )

◆ addItem() [2/2]

virtual void i_LayoutMngr::addItem ( QLayoutItem *  )
virtual

◆ attach()

bool i_LayoutMngr::attach ( constraintType  ,
QWidget &  ,
QWidget *  ,
int  ,
bool  reciprocal = true 
)

◆ borderSpace()

int i_LayoutMngr::borderSpace ( ) const
inline

◆ childrenClear()

void i_LayoutMngr::childrenClear ( uiObject )

◆ childrenCommitGeometrySet()

void i_LayoutMngr::childrenCommitGeometrySet ( bool  )
private

◆ childrenRect()

uiRect i_LayoutMngr::childrenRect ( LayoutMode  )
private

◆ childStretch()

int i_LayoutMngr::childStretch ( bool  hor) const

◆ count()

virtual int i_LayoutMngr::count ( ) const
virtual

◆ curpos() [1/2]

uiRect& i_LayoutMngr::curpos ( LayoutMode  )

◆ curpos() [2/2]

const uiRect& i_LayoutMngr::curpos ( LayoutMode  ) const

◆ doLayout() [1/2]

void i_LayoutMngr::doLayout ( LayoutMode  m,
const QRect &  r 
) const
inlineprivate

◆ doLayout() [2/2]

void i_LayoutMngr::doLayout ( LayoutMode  ,
const QRect &   
)
private

◆ fillResizeList()

void i_LayoutMngr::fillResizeList ( ObjectSet< ResizeItem > &  ,
bool   
)
private

◆ forceChildrenRedraw()

void i_LayoutMngr::forceChildrenRedraw ( uiObjectBody ,
bool  deep 
)

◆ horSpacing()

int i_LayoutMngr::horSpacing ( ) const

◆ initChildLayout()

virtual void i_LayoutMngr::initChildLayout ( LayoutMode  )
virtual

◆ invalidate()

virtual void i_LayoutMngr::invalidate ( )
virtual

◆ isChild()

bool i_LayoutMngr::isChild ( uiObject )

◆ itemAt()

virtual QLayoutItem* i_LayoutMngr::itemAt ( int  idx) const
virtual

◆ itemDel()

void i_LayoutMngr::itemDel ( CallBacker )
private

◆ layoutChildren()

void i_LayoutMngr::layoutChildren ( LayoutMode  ,
bool  finalLoop = false 
)

◆ minimumSize()

virtual QSize i_LayoutMngr::minimumSize ( ) const
virtual

◆ moveChildrenTo()

void i_LayoutMngr::moveChildrenTo ( int  ,
int  ,
LayoutMode   
)
private

◆ popTimTick()

void i_LayoutMngr::popTimTick ( CallBacker )
private

◆ resizeTo()

void i_LayoutMngr::resizeTo ( const QRect &  )
private

◆ setBorderSpace()

void i_LayoutMngr::setBorderSpace ( int  s)
inline

◆ setGeometry()

void i_LayoutMngr::setGeometry ( const QRect &  )
private

◆ setHSpacing()

void i_LayoutMngr::setHSpacing ( int  s)
inline

◆ setIsMain()

void i_LayoutMngr::setIsMain ( bool  yn)
inline

◆ setVSpacing()

void i_LayoutMngr::setVSpacing ( int  s)
inline

◆ sizeHint()

virtual QSize i_LayoutMngr::sizeHint ( ) const
virtual

◆ startPoptimer()

void i_LayoutMngr::startPoptimer ( )
private

◆ takeAt()

virtual QLayoutItem* i_LayoutMngr::takeAt ( int  idx)
virtual

◆ tryToGrowItem()

bool i_LayoutMngr::tryToGrowItem ( ResizeItem &  ,
const int  ,
const int  ,
int  ,
int  ,
const QRect &  ,
int   
)
private

◆ updatedAlignment()

virtual void i_LayoutMngr::updatedAlignment ( LayoutMode  )
virtual

◆ verSpacing()

int i_LayoutMngr::verSpacing ( ) const
inline

◆ winpos()

uiRect i_LayoutMngr::winpos ( LayoutMode  ) const

Friends And Related Function Documentation

◆ i_LayoutItem

i_LayoutItem
friend

◆ uiGroupParentBody

friend class uiGroupParentBody
friend

Member Data Documentation

◆ borderspc_

int i_LayoutMngr::borderspc_
private

◆ childrenlist_

ObjectSet<i_LayoutItem> i_LayoutMngr::childrenlist_
private

◆ hspacing_

int i_LayoutMngr::hspacing_
private

◆ ismain_

bool i_LayoutMngr::ismain_
private

◆ layoutpos_

uiRect i_LayoutMngr::layoutpos_[nLayoutMode]
private

◆ managedbody_

uiObjectBody& i_LayoutMngr::managedbody_
private

◆ minimumdone_

bool i_LayoutMngr::minimumdone_
private

◆ poppedup_

bool i_LayoutMngr::poppedup_
private

◆ poptimer_

Timer& i_LayoutMngr::poptimer_
private

◆ preferreddone_

bool i_LayoutMngr::preferreddone_
private

◆ prefgeometry_

QRect i_LayoutMngr::prefgeometry_
private

◆ prefposstored_

bool i_LayoutMngr::prefposstored_
private

◆ timerrunning_

bool i_LayoutMngr::timerrunning_
private

◆ vspacing_

int i_LayoutMngr::vspacing_
private

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