![]() |
OpendTect
6.6
|
dGB's layout manager More...
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 |
uiRect & | curpos (LayoutMode) |
const uiRect & | curpos (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 |
![]() | |
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 |
![]() | |
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 |
![]() | |
NamedObject (const char *nm=nullptr) | |
NamedObject (const NamedObject &oth) | |
virtual | ~NamedObject () |
virtual BufferString | getName () const |
bool | getNameFromPar (const IOPar &) |
virtual const name_type & | name () const |
NamedObject & | operator= (const NamedObject &) |
bool | operator== (const NamedObject &oth) const |
virtual void | setName (const char *nm) |
![]() | |
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_LayoutItem > | childrenlist_ |
int | hspacing_ |
bool | ismain_ |
uiRect | layoutpos_ [nLayoutMode] |
uiObjectBody & | managedbody_ |
bool | minimumdone_ |
bool | poppedup_ |
Timer & | poptimer_ |
bool | preferreddone_ |
QRect | prefgeometry_ |
bool | prefposstored_ |
bool | timerrunning_ |
int | vspacing_ |
Friends | |
class | i_LayoutItem |
class | uiGroupParentBody |
Additional Inherited Members | |
![]() | |
typedef OD::String | name_type |
![]() | |
static void | createReceiverForCurrentThread () |
static void | removeReceiverForCurrentThread () |
![]() | |
void | sendDelNotif () const |
![]() | |
Threads::Atomic< bool > | delalreadytriggered_ |
Notifier< NamedCallBacker > | delnotif_ |
![]() | |
BufferString | name_ |
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).
i_LayoutMngr::i_LayoutMngr | ( | QWidget * | prnt, |
const char * | name, | ||
uiObjectBody & | mngbdy | ||
) |
|
virtual |
void i_LayoutMngr::addItem | ( | i_LayoutItem * | ) |
|
virtual |
bool i_LayoutMngr::attach | ( | constraintType | , |
QWidget & | , | ||
QWidget * | , | ||
int | , | ||
bool | reciprocal = true |
||
) |
|
inline |
void i_LayoutMngr::childrenClear | ( | uiObject * | ) |
|
private |
|
private |
int i_LayoutMngr::childStretch | ( | bool | hor | ) | const |
|
virtual |
uiRect& i_LayoutMngr::curpos | ( | LayoutMode | ) |
const uiRect& i_LayoutMngr::curpos | ( | LayoutMode | ) | const |
|
inlineprivate |
|
private |
|
private |
void i_LayoutMngr::forceChildrenRedraw | ( | uiObjectBody * | , |
bool | deep | ||
) |
int i_LayoutMngr::horSpacing | ( | ) | const |
|
virtual |
|
virtual |
bool i_LayoutMngr::isChild | ( | uiObject * | ) |
|
virtual |
|
private |
void i_LayoutMngr::layoutChildren | ( | LayoutMode | , |
bool | finalLoop = false |
||
) |
|
virtual |
|
private |
|
private |
|
private |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
virtual |
|
private |
|
virtual |
|
private |
|
virtual |
|
inline |
uiRect i_LayoutMngr::winpos | ( | LayoutMode | ) | const |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Generated at 07/14/2022 09:52:38 for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022