Back to index

salome-gui  6.5.0
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Attributes
QtxWorkstackChild Class Reference

Workarea child widget container. More...

#include <QtxWorkstack.h>

List of all members.

Signals

void shown (QtxWorkstackChild *)
 Emitted when child widget is shown.
void hidden (QtxWorkstackChild *)
 Emitted when child widget is hidden.
void activated (QtxWorkstackChild *)
 Emitted when child widget is activated.
void captionChanged (QtxWorkstackChild *)
 Emitted when child widget's title is changed.

Public Member Functions

 QtxWorkstackChild (QWidget *, QWidget *=0, Qt::WindowFlags=0)
 Constructor.
virtual ~QtxWorkstackChild ()
 Destructor.
QWidget * widget () const
 Get child widget.
int id () const
 Returns the id.
void setId (const int)
 Sets the id.
bool visibility ()
 Returns true if this child window should be visible.
QtxWorkstackAreaarea () const
virtual bool eventFilter (QObject *, QEvent *)
 Custom event filter.

Protected Member Functions

virtual void childEvent (QChildEvent *)
 Customize child event handler.

Private Slots

void onDestroyed (QObject *)
 Called when child widget is destroyed.

Private Attributes

int myId
 id
QPointer< QWidget > myWidget
 child widget

Detailed Description

Workarea child widget container.

Definition at line 302 of file QtxWorkstack.h.


Constructor & Destructor Documentation

QtxWorkstackChild::QtxWorkstackChild ( QWidget *  wid,
QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Constructor.

Parameters:
widchild widget
parentparent widget
fwidget flags

Definition at line 1338 of file QtxWorkstack.cxx.

: QWidget( parent ),
  myId( 0 ),
  myWidget( wid )
{
  if ( myWidget )
  {
    myWidget->setParent( this, f );
    myWidget->installEventFilter( this );
    if ( myWidget->focusProxy() )
      myWidget->focusProxy()->installEventFilter( this );
    myWidget->setVisible( myWidget->isVisibleTo( myWidget->parentWidget() ) );

    QVBoxLayout* base = new QVBoxLayout( this );
    base->setMargin( 0 );
    base->addWidget( myWidget );

    connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
  }
}

Here is the call graph for this function:

Destructor.

Definition at line 1362 of file QtxWorkstack.cxx.

{
  QApplication::instance()->removeEventFilter( this );

  if ( !widget() )
    return;

  disconnect( widget(), SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );

  widget()->hide();
  widget()->removeEventFilter( this );
  if ( widget()->focusProxy() )
    widget()->focusProxy()->removeEventFilter( this );

  widget()->setParent( 0 );
}

Here is the call graph for this function:


Member Function Documentation

Emitted when child widget is activated.

Parameters:
wchild widget container

Here is the caller graph for this function:

Definition at line 1412 of file QtxWorkstack.cxx.

{
  QtxWorkstackArea* a = 0;
  QWidget* w = parentWidget();
  while ( !a && w )
  {
    a = ::qobject_cast<QtxWorkstackArea*>( w );
    w = w->parentWidget();
  }

  return a;
}

Here is the caller graph for this function:

Emitted when child widget's title is changed.

Parameters:
wchild widget container

Here is the caller graph for this function:

void QtxWorkstackChild::childEvent ( QChildEvent *  e) [protected, virtual]

Customize child event handler.

Parameters:
echild event

Definition at line 1466 of file QtxWorkstack.cxx.

{
  if ( e->removed() && e->child() == widget() )
  {
    myWidget = 0;
    deleteLater();
  }
  QWidget::childEvent( e );
}

Here is the call graph for this function:

bool QtxWorkstackChild::eventFilter ( QObject o,
QEvent *  e 
) [virtual]

Custom event filter.

Process events from child widgets.

Parameters:
oevent receiver widget
eevent
Returns:
true if event should be filtered (stop further processing)

Definition at line 1434 of file QtxWorkstack.cxx.

{
  if ( o->isWidgetType() )
  {
    if ( e->type() == QEvent::WindowTitleChange || e->type() == QEvent::WindowIconChange )
      emit captionChanged( this );

    if ( !e->spontaneous() && e->type() == QEvent::ShowToParent )
      emit shown( this );

    if ( !e->spontaneous() && e->type() == QEvent::HideToParent )
      emit hidden( this );

    if ( e->type() == QEvent::FocusIn )
      emit activated( this );
  }
  return QWidget::eventFilter( o, e );
}

Here is the call graph for this function:

Emitted when child widget is hidden.

Parameters:
wchild widget container

Here is the caller graph for this function:

int QtxWorkstackChild::id ( ) const

Returns the id.

Definition at line 1391 of file QtxWorkstack.cxx.

{
  return myId;
}

Here is the caller graph for this function:

void QtxWorkstackChild::onDestroyed ( QObject obj) [private, slot]

Called when child widget is destroyed.

Parameters:
objchild widget being destroyed

Definition at line 1457 of file QtxWorkstack.cxx.

{
  deleteLater();
}

Here is the caller graph for this function:

void QtxWorkstackChild::setId ( const int  id)

Sets the id.

Definition at line 1399 of file QtxWorkstack.cxx.

{
  myId = id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Emitted when child widget is shown.

Parameters:
wchild widget container

Here is the caller graph for this function:

Returns true if this child window should be visible.

Definition at line 1407 of file QtxWorkstack.cxx.

{
  return myWidget ? myWidget->isVisibleTo( this ) : false;
}

Here is the caller graph for this function:

QWidget * QtxWorkstackChild::widget ( ) const

Get child widget.

Returns:
child widget

Definition at line 1383 of file QtxWorkstack.cxx.

{
  return myWidget;
}

Here is the caller graph for this function:


Member Data Documentation

int QtxWorkstackChild::myId [private]

id

Definition at line 335 of file QtxWorkstack.h.

QPointer<QWidget> QtxWorkstackChild::myWidget [private]

child widget

Definition at line 336 of file QtxWorkstack.h.


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