Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Métodos protegidos | Propiedades | Amigas
Referencia de la Clase QSplitter

The QSplitter class implements a splitter widget. Más...

#include <qsplitter.h>

Diagrama de herencias de QSplitter
QFrame QFrame QWidget QWidget QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject

Lista de todos los miembros.

Tipos públicos

enum  ResizeMode {
  Stretch, KeepSize, FollowSizeHint, Auto,
  Stretch, KeepSize, FollowSizeHint, Auto
}
enum  ResizeMode {
  Stretch, KeepSize, FollowSizeHint, Auto,
  Stretch, KeepSize, FollowSizeHint, Auto
}

Métodos públicos

 QSplitter (QWidget *parent=0, const char *name=0)
 QSplitter (Orientation, QWidget *parent=0, const char *name=0)
 ~QSplitter ()
virtual void setOrientation (Orientation)
Orientation orientation () const
void setChildrenCollapsible (bool)
bool childrenCollapsible () const
void setCollapsible (QWidget *w, bool)
virtual void setResizeMode (QWidget *w, ResizeMode)
virtual void setOpaqueResize (bool=TRUE)
bool opaqueResize () const
void moveToFirst (QWidget *)
void moveToLast (QWidget *)
void refresh ()
QSize sizeHint () const
QSize minimumSizeHint () const
QValueList< intsizes () const
void setSizes (QValueList< int >)
int handleWidth () const
void setHandleWidth (int)
 QSplitter (QWidget *parent=0, const char *name=0)
 QSplitter (Orientation, QWidget *parent=0, const char *name=0)
 ~QSplitter ()
virtual void setOrientation (Orientation)
Orientation orientation () const
void setChildrenCollapsible (bool)
bool childrenCollapsible () const
void setCollapsible (QWidget *w, bool)
virtual void setResizeMode (QWidget *w, ResizeMode)
virtual void setOpaqueResize (bool=TRUE)
bool opaqueResize () const
void moveToFirst (QWidget *)
void moveToLast (QWidget *)
void refresh ()
QSize sizeHint () const
QSize minimumSizeHint () const
QValueList< intsizes () const
void setSizes (QValueList< int >)
int handleWidth () const
void setHandleWidth (int)

Métodos protegidos

void childEvent (QChildEvent *)
bool event (QEvent *)
void resizeEvent (QResizeEvent *)
int idAfter (QWidget *) const
void moveSplitter (QCOORD pos, int id)
virtual void drawSplitter (QPainter *, QCOORD x, QCOORD y, QCOORD w, QCOORD h)
void styleChange (QStyle &)
int adjustPos (int, int)
virtual void setRubberband (int)
void getRange (int id, int *, int *)
void childEvent (QChildEvent *)
bool event (QEvent *)
void resizeEvent (QResizeEvent *)
int idAfter (QWidget *) const
void moveSplitter (QCOORD pos, int id)
virtual void drawSplitter (QPainter *, QCOORD x, QCOORD y, QCOORD w, QCOORD h)
void styleChange (QStyle &)
int adjustPos (int, int)
virtual void setRubberband (int)
void getRange (int id, int *, int *)

Propiedades

Orientation orientation
 the orientation of the splitter
bool opaqueResize
 whether resizing is opaque
int handleWidth
 the width of the splitter handle
bool childrenCollapsible
 whether child widgets can be resized down to size 0 by the user

Amigas

class QSplitterHandle
Q_EXPORT QTextStreamoperator<< (QTextStream &, const QSplitter &)
Q_EXPORT QTextStreamoperator>> (QTextStream &, QSplitter &)
Q_EXPORT QTextStreamoperator<< (QTextStream &, const QSplitter &)
Q_EXPORT QTextStreamoperator>> (QTextStream &, QSplitter &)

Descripción detallada

The QSplitter class implements a splitter widget.

A splitter lets the user control the size of child widgets by dragging the boundary between the children. Any number of widgets may be controlled by a single splitter.

To show a QListBox, a QListView and a QTextEdit side by side:

        QSplitter *split = new QSplitter( parent );
        QListBox *lb = new QListBox( split );
        QListView *lv = new QListView( split );
        QTextEdit *ed = new QTextEdit( split );

QSplitter lays out its children horizontally (side by side); you can use setOrientation(QSplitter::Vertical) to lay out the children vertically.

By default, all widgets can be as large or as small as the user wishes, between the minimumSizeHint() (or minimumSize()) and maximumSize() of the widgets. Use setResizeMode() to specify that a widget should keep its size when the splitter is resized, or set the stretch component of the sizePolicy.

Although QSplitter normally resizes the children only at the end of a resize operation, if you call setOpaqueResize(TRUE) the widgets are resized as often as possible.

The initial distribution of size between the widgets is determined by the initial size of each widget. You can also use setSizes() to set the sizes of all the widgets. The function sizes() returns the sizes set by the user.

If you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again. It is also possible to reorder the widgets within the splitter using moveToFirst() and moveToLast().

qsplitter-m.png
qsplitter-w.png
Ver también:
QTabBar

Documentación de las enumeraciones miembro de la clase

This enum type describes how QSplitter will resize each of its child widgets.

Auto The widget will be resized according to the stretch factors set in its sizePolicy().

Stretch The widget will be resized when the splitter itself is resized.

KeepSize QSplitter will try to keep the widget's size unchanged.

FollowSizeHint QSplitter will resize the widget when the widget's size hint changes.

Valores de enumeraciones:
Stretch 
KeepSize 
FollowSizeHint 
Auto 
Stretch 
KeepSize 
FollowSizeHint 
Auto 
Valores de enumeraciones:
Stretch 
KeepSize 
FollowSizeHint 
Auto 
Stretch 
KeepSize 
FollowSizeHint 
Auto 

Documentación del constructor y destructor

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

Constructs a horizontal splitter with the parent and name arguments being passed on to the QFrame constructor.

QSplitter::QSplitter ( Orientation  o,
QWidget parent = 0,
const char *  name = 0 
)

Constructs a splitter with orientation o with the parent and name arguments being passed on to the QFrame constructor.

QSplitter::~QSplitter ( )

Destroys the splitter and any children.

QSplitter::QSplitter ( QWidget parent = 0,
const char *  name = 0 
)
QSplitter::QSplitter ( Orientation  ,
QWidget parent = 0,
const char *  name = 0 
)
QSplitter::~QSplitter ( )

Documentación de las funciones miembro

int QSplitter::adjustPos ( int  pos,
int  id 
) [protected]

Returns the closest legal position to pos of the widget with ID id.

Ver también:
idAfter()
int QSplitter::adjustPos ( int  ,
int   
) [protected]
void QSplitter::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 QSplitter::childEvent ( QChildEvent c) [protected, virtual]

Tells the splitter that the child widget described by c has been inserted or removed.

Reimplementado de QObject.

bool QSplitter::childrenCollapsible ( ) const
bool QSplitter::childrenCollapsible ( ) const
void QSplitter::drawSplitter ( QPainter p,
QCOORD  x,
QCOORD  y,
QCOORD  w,
QCOORD  h 
) [protected, virtual]

Draws the splitter handle in the rectangle described by x, y, w, h using painter p.

Ver también:
QStyle::drawPrimitive()
virtual void QSplitter::drawSplitter ( QPainter ,
QCOORD  x,
QCOORD  y,
QCOORD  w,
QCOORD  h 
) [protected, virtual]
bool QSplitter::event ( QEvent e) [protected, virtual]

Reimplementado de QWidget.

bool QSplitter::event ( QEvent e) [protected, virtual]

This is the main event handler; it handles event e. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.

The main event handler first passes an event through all event filters that have been installed. If none of the filters intercept the event, it calls one of the specialized event handlers.

Key press and release events are treated differently from other events. event() checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event() calls keyPressEvent().

This function returns TRUE if it is able to pass the event over to someone (i.e. someone wanted the event); otherwise returns FALSE.

Ver también:
closeEvent(), focusInEvent(), focusOutEvent(), enterEvent(), keyPressEvent(), keyReleaseEvent(), leaveEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), moveEvent(), paintEvent(), resizeEvent(), QObject::event(), QObject::timerEvent()

Reimplementado de QWidget.

void QSplitter::getRange ( int  id,
int min,
int max 
) [protected]

Returns the valid range of the splitter with ID id in *min and *max if min and max are not 0.

Ver también:
idAfter()
void QSplitter::getRange ( int  id,
int ,
int  
) [protected]
int QSplitter::handleWidth ( ) const
int QSplitter::handleWidth ( ) const
int QSplitter::idAfter ( QWidget w) const [protected]

Returns the ID of the widget to the right of or below the widget w, or 0 if there is no such widget (i.e. it is either not in this QSplitter or w is at the end).

int QSplitter::idAfter ( QWidget ) const [protected]
QSize QSplitter::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QSplitter::minimumSizeHint ( ) const [virtual]

Reimplementado de QWidget.

void QSplitter::moveSplitter ( QCOORD  p,
int  id 
) [protected]

Moves the left/top edge of the splitter handle with ID id as close as possible to position p, which is the distance from the left (or top) edge of the widget.

For Arabic, Hebrew and other right-to-left languages the layout is reversed. p is then the distance from the right (or top) edge of the widget.

Ver también:
idAfter()
void QSplitter::moveSplitter ( QCOORD  pos,
int  id 
) [protected]
void QSplitter::moveToFirst ( QWidget )
void QSplitter::moveToFirst ( QWidget w)

Moves widget w to the leftmost/top position.

void QSplitter::moveToLast ( QWidget )
void QSplitter::moveToLast ( QWidget w)

Moves widget w to the rightmost/bottom position.

bool QSplitter::opaqueResize ( ) const
bool QSplitter::opaqueResize ( ) const
Orientation QSplitter::orientation ( ) const [inline]
Orientation QSplitter::orientation ( ) const [inline]
void QSplitter::refresh ( ) [inline]
void QSplitter::refresh ( ) [inline]

Updates the splitter's state. You should not need to call this function.

void QSplitter::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.

void QSplitter::resizeEvent ( QResizeEvent ) [protected, virtual]

Reimplementado de QFrame.

void QSplitter::setChildrenCollapsible ( bool  collapse)
void QSplitter::setChildrenCollapsible ( bool  )
void QSplitter::setCollapsible ( QWidget w,
bool   
)
void QSplitter::setCollapsible ( QWidget w,
bool  collapse 
)

Sets whether the child widget w is collapsible to collapse.

By default, children are collapsible, meaning that the user can resize them down to size 0, even if they have a non-zero minimumSize() or minimumSizeHint(). This behavior can be changed on a per-widget basis by calling this function, or globally for all the widgets in the splitter by setting the childrenCollapsible property.

Ver también:
childrenCollapsible
void QSplitter::setHandleWidth ( int  width)
void QSplitter::setHandleWidth ( int  )
virtual void QSplitter::setOpaqueResize ( bool  = TRUE) [virtual]
void QSplitter::setOpaqueResize ( bool  on = TRUE) [virtual]
void QSplitter::setOrientation ( Orientation  o) [virtual]
virtual void QSplitter::setOrientation ( Orientation  ) [virtual]
virtual void QSplitter::setResizeMode ( QWidget w,
ResizeMode   
) [virtual]
void QSplitter::setResizeMode ( QWidget w,
ResizeMode  mode 
) [virtual]

Sets resize mode of widget w to mode. (The default is Auto.)

void QSplitter::setRubberband ( int  p) [protected, virtual]

Displays a rubber band at position p. If p is negative, the rubber band is removed.

virtual void QSplitter::setRubberband ( int  ) [protected, virtual]
void QSplitter::setSizes ( QValueList< int )
void QSplitter::setSizes ( QValueList< int list)

Sets the size parameters to the values given in the list. If the splitter is horizontal, the values set the widths of each widget going from left to right. If the splitter is vertical, the values set the heights of each widget going from top to bottom. Extra values in the list are ignored.

If list contains too few values, the result is undefined but the program will still be well-behaved.

Note that the values in list should be the height/width that the widgets should be resized to.

Ver también:
sizes()
QSize QSplitter::sizeHint ( ) const [virtual]

Reimplementado de QFrame.

QSize QSplitter::sizeHint ( ) const [virtual]

Reimplementado de QFrame.

QValueList<int> QSplitter::sizes ( ) const
QValueList< int > QSplitter::sizes ( ) const

Returns a list of the size parameters of all the widgets in this splitter.

If the splitter's orientation is horizontal, the list is a list of widget widths; if the orientation is vertical, the list is a list of widget heights.

Giving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one.

Note that if you want to iterate over the list, you should iterate over a copy, e.g.

    QValueList<int> list = mySplitter.sizes();
    QValueList<int>::Iterator it = list.begin();
    while( it != list.end() ) {
        myProcessing( *it );
        ++it;
    }
Ver también:
setSizes()
void QSplitter::styleChange ( QStyle old) [protected, virtual]

Reimplementado de QFrame.

void QSplitter::styleChange ( QStyle old) [protected, virtual]

Reimplementado de QFrame.


Documentación de las funciones relacionadas y clases amigas

QTextStream & operator<< ( QTextStream ts,
const QSplitter splitter 
) [friend]

Writes the sizes and the hidden state of the widgets in the splitter splitter to the text stream ts.

Ver también:
operator>>(), sizes(), QWidget::isHidden()
Q_EXPORT QTextStream& operator<< ( QTextStream ,
const QSplitter  
) [friend]
Q_EXPORT QTextStream& operator>> ( QTextStream ,
QSplitter  
) [friend]
QTextStream & operator>> ( QTextStream ts,
QSplitter splitter 
) [friend]

Reads the sizes and the hidden state of the widgets in the splitter splitter from the text stream ts. The sizes must have been previously written by the operator<<() function.

Ver también:
operator<<(), setSizes(), QWidget::hide()
QSplitterHandle [friend]

Documentación de propiedades

bool QSplitter::childrenCollapsible [read, write]

whether child widgets can be resized down to size 0 by the user

By default, children are collapsible. It is possible to enable and disable the collapsing of individual children; see setCollapsible().

int QSplitter::handleWidth [read, write]

the width of the splitter handle

bool QSplitter::opaqueResize [read, write]

whether resizing is opaque

Opaque resizing is off by default.

Orientation QSplitter::orientation [read, write]

the orientation of the splitter

By default the orientation is horizontal (the widgets are side by side). The possible orientations are Horizontal and Vertical.


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'