Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
QDS_Datum::Wrapper Class Reference

Wrapper for sub widgets. More...

List of all members.

Public Member Functions

 Wrapper (QWidget *=0)
 Constructor.
virtual ~Wrapper ()
 Destructor.
QWidget * widget () const
 Get widget.
void setWidget (QWidget *)
 Set widget.
virtual void setGeometry (int x, int y, int w, int h)
 Set widget geometry.
virtual void setSizePolicy (QSizePolicy)
 Set size policy of the widget.

Private Attributes

QWidget * myWid

Detailed Description

Wrapper for sub widgets.

Definition at line 41 of file QDS_Datum.cxx.


Constructor & Destructor Documentation

QDS_Datum::Wrapper::Wrapper ( QWidget *  parent = 0)

Constructor.

Parameters:
parentparent widget

Definition at line 61 of file QDS_Datum.cxx.

: QWidget( parent ),
  myWid( 0 )
{
  setLayout( new QHBoxLayout() );
  layout()->setSpacing( 0 );
  layout()->setMargin( 0 );
  setFocusPolicy( Qt::StrongFocus );
}

Destructor.

Definition at line 74 of file QDS_Datum.cxx.

{
}

Member Function Documentation

void QDS_Datum::Wrapper::setGeometry ( int  x,
int  y,
int  w,
int  h 
) [virtual]

Set widget geometry.

Parameters:
xhorizontal position
yvertical position
wwidget width
hwidget height

Definition at line 129 of file QDS_Datum.cxx.

{
  QWidget::setGeometry( x, y, w, h );

  if ( widget() && widget()->size() != size() )
    widget()->setGeometry( 0, 0, width(), height() );
}
void QDS_Datum::Wrapper::setSizePolicy ( QSizePolicy  sp) [virtual]

Set size policy of the widget.

Parameters:
spnew size policy

Definition at line 114 of file QDS_Datum.cxx.

{
  QWidget::setSizePolicy( sp );

  if ( widget() )
    widget()->setSizePolicy( sp );
}
void QDS_Datum::Wrapper::setWidget ( QWidget *  wid)

Set widget.

Parameters:
widwidget

Definition at line 91 of file QDS_Datum.cxx.

{
  if ( myWid == wid || !wid )
    return;

  wid->setParent( this );
  QHBoxLayout* hl = qobject_cast<QHBoxLayout*>( layout() );
  if( myWid )
    hl->removeWidget( myWid );
  hl->addWidget( wid );
  myWid = wid;

  setTabOrder( this, myWid );
  setFocusProxy( myWid );

  myWid->updateGeometry();
  updateGeometry();
}
QWidget * QDS_Datum::Wrapper::widget ( ) const

Get widget.

Returns:
widget

Definition at line 82 of file QDS_Datum.cxx.

{
  return myWid;
}

Member Data Documentation

QWidget* QDS_Datum::Wrapper::myWid [private]

Definition at line 54 of file QDS_Datum.cxx.


The documentation for this class was generated from the following file: