Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos
Referencia de la Clase QWidgetStack

The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible. Más...

#include <qwidgetstack.h>

Diagrama de herencias de QWidgetStack
QFrame QFrame QWidget QWidget QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QDesignerWidgetStack

Lista de todos los miembros.

Slots públicos

void raiseWidget (int)
void raiseWidget (QWidget *)
void raiseWidget (int)
void raiseWidget (QWidget *)

Señales

void aboutToShow (int)
void aboutToShow (QWidget *)
void aboutToShow (int)
void aboutToShow (QWidget *)

Métodos públicos

 QWidgetStack (QWidget *parent=0, const char *name=0)
 QWidgetStack (QWidget *parent, const char *name, WFlags f)
 ~QWidgetStack ()
int addWidget (QWidget *, int=-1)
void removeWidget (QWidget *)
QSize sizeHint () const
QSize minimumSizeHint () const
void show ()
QWidgetwidget (int) const
int id (QWidget *) const
QWidgetvisibleWidget () const
void setFrameRect (const QRect &)
 QWidgetStack (QWidget *parent=0, const char *name=0)
 QWidgetStack (QWidget *parent, const char *name, WFlags f)
 ~QWidgetStack ()
int addWidget (QWidget *, int=-1)
void removeWidget (QWidget *)
QSize sizeHint () const
QSize minimumSizeHint () const
void show ()
QWidgetwidget (int) const
int id (QWidget *) const
QWidgetvisibleWidget () const
void setFrameRect (const QRect &)

Métodos protegidos

void frameChanged ()
void resizeEvent (QResizeEvent *)
virtual void setChildGeometries ()
void childEvent (QChildEvent *)
void frameChanged ()
void resizeEvent (QResizeEvent *)
virtual void setChildGeometries ()
void childEvent (QChildEvent *)

Descripción detallada

The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible.

The application programmer can move any widget to the top of the stack at any time using raiseWidget(), and add or remove widgets using addWidget() and removeWidget(). It is not sufficient to pass the widget stack as parent to a widget which should be inserted into the widgetstack.

visibleWidget() is the get equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack.

QWidgetStack also provides the ability to manipulate widgets through application-specified integer IDs. You can also translate from widget pointers to IDs using id() and from IDs to widget pointers using widget(). These numeric IDs are unique (per QWidgetStack, not globally), but QWidgetStack does not attach any additional meaning to them.

The default widget stack is frameless, but you can use the usual QFrame functions (such as setFrameStyle()) to add a frame.

QWidgetStack provides a signal, aboutToShow(), which is emitted just before a managed widget is shown.

Ver también:
QTabDialog QTabBar QFrame

Documentación del constructor y destructor

QWidgetStack::QWidgetStack ( QWidget parent = 0,
const char *  name = 0 
)

Constructs an empty widget stack.

The parent and name arguments are passed to the QFrame constructor.

QWidgetStack::QWidgetStack ( QWidget parent,
const char *  name,
WFlags  f 
)

Constructs an empty widget stack.

The parent, name and f arguments are passed to the QFrame constructor.

QWidgetStack::~QWidgetStack ( )

Destroys the object and frees any allocated resources.

QWidgetStack::QWidgetStack ( QWidget parent = 0,
const char *  name = 0 
)
QWidgetStack::QWidgetStack ( QWidget parent,
const char *  name,
WFlags  f 
)
QWidgetStack::~QWidgetStack ( )

Documentación de las funciones miembro

void QWidgetStack::aboutToShow ( int  t0) [signal]

This signal is emitted just before a managed widget is shown if that managed widget has an ID != -1. The argument is the numeric ID of the widget.

If you call visibleWidget() in a slot connected to aboutToShow(), the widget it returns is the one that is currently visible, not the one that is about to be shown.

void QWidgetStack::aboutToShow ( QWidget t0) [signal]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.

If you call visibleWidget() in a slot connected to aboutToShow(), the widget returned is the one that is currently visible, not the one that is about to be shown.

void QWidgetStack::aboutToShow ( int  ) [signal]
void QWidgetStack::aboutToShow ( QWidget ) [signal]
int QWidgetStack::addWidget ( QWidget ,
int  = -1 
)
int QWidgetStack::addWidget ( QWidget w,
int  id = -1 
)

Adds widget w to this stack of widgets, with ID id.

If you pass an id >= 0 this ID is used. If you pass an id of -1 (the default), the widgets will be numbered automatically. If you pass -2 a unique negative integer will be generated. No widget has an ID of -1. Returns the ID or -1 on failure (e.g. w is 0).

If you pass an id that is already used, then a unique negative integer will be generated to prevent two widgets having the same id.

If w already exists in the stack the widget will be removed first.

If w is not a child of this QWidgetStack moves it using reparent().

void QWidgetStack::childEvent ( QChildEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive child events.

Child events are sent to objects when children are inserted or removed.

Note that events with QEvent::type() QEvent::ChildInserted are posted (with {QApplication::postEvent()}) to make sure that the child's construction is completed before this function is called.

If a child is removed immediately after it is inserted, the ChildInserted event may be suppressed, but the ChildRemoved event will always be sent. In such cases it is possible that there will be a ChildRemoved event without a corresponding ChildInserted event.

If you change state based on ChildInserted events, call QWidget::constPolish(), or do

in functions that depend on the state. One notable example is QWidget::sizeHint().

Ver también:
event(), QChildEvent

Reimplementado de QObject.

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

Reimplementado de QObject.

void QWidgetStack::frameChanged ( ) [protected, virtual]

Reimplementado de QFrame.

void QWidgetStack::frameChanged ( ) [protected, virtual]

Virtual function that is called when the frame style, line width or mid-line width changes.

This function can be reimplemented by subclasses that need to know when the frame attributes change.

The default implementation calls update().

Reimplementado de QFrame.

int QWidgetStack::id ( QWidget ) const
int QWidgetStack::id ( QWidget widget) const

Returns the ID of the widget. Returns -1 if widget is 0 or is not being managed by this widget stack.

Ver también:
widget() addWidget()
QSize QWidgetStack::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QWidgetStack::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

void QWidgetStack::raiseWidget ( int  ) [slot]
void QWidgetStack::raiseWidget ( int  id) [slot]

Raises the widget with ID id to the top of the widget stack.

Ver también:
visibleWidget()
void QWidgetStack::raiseWidget ( QWidget w) [slot]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Raises widget w to the top of the widget stack.

void QWidgetStack::raiseWidget ( QWidget ) [slot]
void QWidgetStack::removeWidget ( QWidget w)

Removes widget w from this stack of widgets. Does not delete w. If w is the currently visible widget, no other widget is substituted.

Ver también:
visibleWidget() raiseWidget()
void QWidgetStack::removeWidget ( QWidget )
void QWidgetStack::resizeEvent ( QResizeEvent e) [protected, virtual]

Processes the resize event e.

Adjusts the frame rectangle for the resized widget. The frame rectangle is elastic, and the surrounding area is static.

The resulting frame rectangle may be null or invalid. You can use setMinimumSize() to avoid those possibilities.

Nothing is done if the frame rectangle is a null rectangle already.

Reimplementado de QFrame.

Reimplementado en QDesignerWidgetStack.

void QWidgetStack::resizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QFrame.

Reimplementado en QDesignerWidgetStack.

void QWidgetStack::setChildGeometries ( ) [protected, virtual]

Fixes up the children's geometries.

virtual void QWidgetStack::setChildGeometries ( ) [protected, virtual]
void QWidgetStack::setFrameRect ( const QRect r) [virtual]

Reimplementado de QFrame.

void QWidgetStack::setFrameRect ( const QRect ) [virtual]

Reimplementado de QFrame.

void QWidgetStack::show ( ) [virtual]

Reimplementado de QWidget.

void QWidgetStack::show ( ) [virtual]

Shows the widget and its child widgets.

If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown.

You almost never have to reimplement this function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use polish().

Ver también:
showEvent(), hide(), showMinimized(), showMaximized(), showNormal(), isVisible(), polish()

Reimplementado de QWidget.

QSize QWidgetStack::sizeHint ( ) const [virtual]

Reimplementado de QFrame.

QSize QWidgetStack::sizeHint ( ) const [virtual]

Reimplementado de QFrame.

QWidget * QWidgetStack::visibleWidget ( ) const

Returns the currently visible widget (the one at the top of the stack), or 0 if nothing is currently being shown.

Ver también:
aboutToShow() id() raiseWidget()
QWidget* QWidgetStack::visibleWidget ( ) const
QWidget * QWidgetStack::widget ( int  id) const

Returns the widget with ID id. Returns 0 if this widget stack does not manage a widget with ID id.

Ver también:
id() addWidget()
QWidget* QWidgetStack::widget ( int  ) const

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'