com.trolltech.qt.gui
Class QVBoxLayout
java.lang.Object
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QLayout
com.trolltech.qt.gui.QBoxLayout
com.trolltech.qt.gui.QVBoxLayout
- All Implemented Interfaces:
- QLayoutItemInterface, QtJambiInterface
public class QVBoxLayout
- extends QBoxLayout
The QVBoxLayout class lines up widgets vertically.
This class is used to construct vertical box layout objects. See QBoxLayout for details.
The simplest use of the class is like this:
QWidget *window = new QWidget;
QPushButton *button1 = new QPushButton("One");
QPushButton *button2 = new QPushButton("Two");
QPushButton *button3 = new QPushButton("Three");
QPushButton *button4 = new QPushButton("Four");
QPushButton *button5 = new QPushButton("Five");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(button1);
layout->addWidget(button2);
layout->addWidget(button3);
layout->addWidget(button4);
layout->addWidget(button5);
window->setLayout(layout);
window->show();
First, we create the widgets we want in the layout. Then, we create the QVBoxLayout object and add the widgets into the layout. Finally, we call QWidget::setLayout() to install the QVBoxLayout object onto the widget. At that point, the widgets in the layout are reparented to have window as their parent.

- See Also:
- QHBoxLayout,
QGridLayout,
QStackedLayout,
Layout Classes,
Layouts Example
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary |
QVBoxLayout()
Constructs a new vertical box. |
QVBoxLayout(QWidget parent)
Constructs a new top-level vertical box with parent parent. |
Methods inherited from class com.trolltech.qt.gui.QBoxLayout |
addItem, addLayout, addLayout, addSpacing, addStretch, addStretch, addStrut, addWidget, addWidget, count, direction, expandingDirections, hasHeightForWidth, heightForWidth, insertItem, insertLayout, insertLayout, insertSpacing, insertStretch, insertStretch, insertWidget, insertWidget, insertWidget, insertWidget, invalidate, itemAt, maximumSize, minimumHeightForWidth, minimumSize, setDirection, setGeometry, setSpacing, setStretchFactor, setStretchFactor, sizeHint, spacing, takeAt |
Methods inherited from class com.trolltech.qt.gui.QLayout |
activate, addChildLayout, addChildWidget, addWidget, alignment, alignmentRect, childEvent, closestAcceptableSize, contentsRect, controlTypes, geometry, getContentsMargins, indexOf, isEmpty, isEnabled, layout, menuBar, parentWidget, removeItem, removeWidget, setAlignment, setAlignment, setAlignment, setAlignment, setContentsMargins, setContentsMargins, setEnabled, setMargin, setMenuBar, setSizeConstraint, setWidgetSpacing, sizeConstraint, spacerItem, totalHeightForWidth, totalMaximumSize, totalMinimumSize, totalSizeHint, update, widget, widgetEvent, widgetSpacing |
Methods inherited from class com.trolltech.qt.core.QObject |
blockSignals, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QVBoxLayout
public QVBoxLayout(QWidget parent)
Constructs a new top-level vertical box with parent parent.
QVBoxLayout
public QVBoxLayout()
Constructs a new vertical box. You must add it to another layout.
fromNativePointer
public static QVBoxLayout fromNativePointer(QNativePointer nativePointer)
- This function returns the QVBoxLayout instance pointed to by nativePointer
- Parameters:
nativePointer
- the QNativePointer of which object should be returned.