15 #include "uibasemod.h" 28 friend class i_LayoutIterator;
30 friend class uiGroupParentBody;
36 virtual ~i_LayoutItem();
39 {
return curpos(m).left(); }
40 virtual int centre(
LayoutMode m,
bool hor=
true)
const 42 if( hor )
return ( curpos(m).
left()
43 + curpos(m).
right() ) / 2;
44 return ( curpos(m).top()
45 + curpos(m).bottom() ) / 2;
48 virtual uiSize minimumsize()
const 50 mQtclass(QSize) s =qwidget()->minimumSize();
53 uiSize( s.width(), s.height());
59 {
pErrMsg(
"PrefSize already done.");}
63 const_cast<i_LayoutItem*
>(
this);
64 self->prefSzDone =
true;
65 mQtclass(QSize) ps( qlayoutItm().sizeHint() );
66 int width = ps.width();
67 if ( width==0 ) width = 1;
68 int height = ps.height();
69 if ( height==0 ) height = 1;
77 virtual
void invalidate();
81 uiSize actualsize(
bool include_border =
true)
const;
84 inline const i_LayoutMngr& mngr()
const {
return mngr_; }
87 {
return layoutpos[m];}
92 return minimum_pos_inited
93 || preferred_pos_inited;
98 bool preferred_pos_inited;
99 bool minimum_pos_inited;
103 int stretch(
bool hor )
const;
104 virtual void commitGeometrySet(
bool);
111 i_LayoutItem *other,
int margin,
112 bool reciprocal=
true);
114 virtual uiObject* objLayouted() {
return 0; }
115 inline const uiObject* objLayouted()
const 117 return const_cast<i_LayoutItem*
> 118 (
this)->objLayouted();
121 virtual uiObjectBody* bodyLayouted() {
return 0; }
122 inline const uiObjectBody* bodyLayouted()
const 124 return const_cast<i_LayoutItem*
> 125 (
this)->bodyLayouted();
128 inline mQtclass(QLayoutItem&) qlayoutItm() {
return *qlayoutitm; }
129 inline const mQtclass(QLayoutItem&) qlayoutItm()
const 130 {
return *qlayoutitm; }
134 inline mQtclass(QLayoutItem*) takeQlayoutItm()
136 mQtclass(QLayoutItem*) ret = qlayoutitm;
142 {
return qlayoutitm->widget(); }
143 virtual const mQtclass(QWidget*) managewidg_()
const 144 {
return qlayoutitm->widget(); }
148 bool isAligned()
const;
173 *new
mQtclass(QWidgetItem)(obj.qwidget()) )
180 uiSize s = uiObjBody_.minimumsize();
184 return i_LayoutItem::minimumsize();
#define mExpClass(module)
Definition: commondefs.h:160
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
Definition: uilayout.h:39
virtual uiObject * objLayouted()
Definition: i_layoutitem.h:187
#define mQtclass(cls)
Definition: commondefs.h:229
Wrapper around QLayoutItem class. Stores some dGB specific layout info.
Definition: i_layoutitem.h:168
uiObjectBody & uiObjBody_
Definition: i_layoutitem.h:193
if(!noudf_ &&(mIsUdf(inpval)))
Definition: arrayndalgo.h:1662
Definition: i_layout.h:28
The base class for most UI elements.
Definition: uiobj.h:38
virtual uiSize minimumsize() const
Definition: i_layoutitem.h:178
virtual const QWidget * qwidget_() const
Definition: i_uiobjqtbody.h:28
Set of (small) copyable elements.
Definition: commontypes.h:30
i_uiLayoutItem(i_LayoutMngr &mgr, uiObjectBody &obj)
Definition: i_layoutitem.h:171
LayoutMode
Definition: i_layout.h:35
virtual uiObjectBody * bodyLayouted()
Definition: i_layoutitem.h:188
#define mFDQtclass(cls)
Definition: commondefs.h:228
Object with a name.
Definition: namedobj.h:35
constraintType
Definition: uilayout.h:19
const int nLayoutMode
Definition: i_layout.h:37
int hNrPics() const
Definition: uigeom.h:33
#define pErrMsg(msg)
Definition: errmsg.h:60
dGB's layout manager
Definition: i_layout.h:70
Definition: i_layout.h:28