Qt 4.8
|
The QGridLayout class lays out widgets in a grid. More...
#include <qgridlayout.h>
Public Functions | |
void | addItem (QLayoutItem *item, int row, int column, int rowSpan=1, int columnSpan=1, Qt::Alignment=0) |
Adds item at position row, column, spanning rowSpan rows and columnSpan columns, and aligns it according to alignment. More... | |
void | addLayout (QLayout *, int row, int column, Qt::Alignment=0) |
Places the layout at position (row, column) in the grid. More... | |
void | addLayout (QLayout *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment=0) |
This version adds the layout layout to the cell grid, spanning multiple rows/columns. More... | |
void | addWidget (QWidget *w) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | addWidget (QWidget *, int row, int column, Qt::Alignment=0) |
Adds the given widget to the cell grid at row, column. More... | |
void | addWidget (QWidget *, int row, int column, int rowSpan, int columnSpan, Qt::Alignment=0) |
This version adds the given widget to the cell grid, spanning multiple rows/columns. More... | |
QRect | cellRect (int row, int column) const |
Returns the geometry of the cell with row row and column column in the grid. More... | |
int | columnCount () const |
Returns the number of columns in this grid. More... | |
int | columnMinimumWidth (int column) const |
Returns the column spacing for column column. More... | |
int | columnStretch (int column) const |
Returns the stretch factor for column column. More... | |
int | count () const |
Reimplemented Function More... | |
Qt::Orientations | expandingDirections () const |
Reimplemented Function More... | |
void | getItemPosition (int idx, int *row, int *column, int *rowSpan, int *columnSpan) |
Returns the position information of the item with the given index. More... | |
bool | hasHeightForWidth () const |
Reimplemented Function More... | |
int | heightForWidth (int) const |
Reimplemented Function More... | |
int | horizontalSpacing () const |
the spacing between widgets that are laid out side by side More... | |
void | invalidate () |
Reimplemented Function More... | |
QLayoutItem * | itemAt (int index) const |
Reimplemented Function More... | |
QLayoutItem * | itemAtPosition (int row, int column) const |
Returns the layout item that occupies cell (row, column), or 0 if the cell is empty. More... | |
QSize | maximumSize () const |
Reimplemented Function More... | |
int | minimumHeightForWidth (int) const |
Reimplemented Function More... | |
QSize | minimumSize () const |
Reimplemented Function More... | |
Qt::Corner | originCorner () const |
Returns the corner that's used for the grid's origin, i.e. More... | |
QGridLayout (QWidget *parent) | |
Constructs a new QGridLayout with parent widget, parent. More... | |
QGridLayout () | |
Constructs a new grid layout. More... | |
int | rowCount () const |
Returns the number of rows in this grid. More... | |
int | rowMinimumHeight (int row) const |
Returns the minimum width set for row row. More... | |
int | rowStretch (int row) const |
Returns the stretch factor for row row. More... | |
void | setColumnMinimumWidth (int column, int minSize) |
Sets the minimum width of column column to minSize pixels. More... | |
void | setColumnStretch (int column, int stretch) |
Sets the stretch factor of column column to stretch. More... | |
void | setDefaultPositioning (int n, Qt::Orientation orient) |
void | setGeometry (const QRect &) |
Reimplemented Function More... | |
void | setHorizontalSpacing (int spacing) |
void | setOriginCorner (Qt::Corner) |
Sets the grid's origin corner, i.e. More... | |
void | setRowMinimumHeight (int row, int minSize) |
Sets the minimum height of row row to minSize pixels. More... | |
void | setRowStretch (int row, int stretch) |
Sets the stretch factor of row row to stretch. More... | |
void | setSpacing (int spacing) |
This function sets both the vertical and horizontal spacing to spacing. More... | |
void | setVerticalSpacing (int spacing) |
QSize | sizeHint () const |
Reimplemented Function More... | |
int | spacing () const |
If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwise it return -1. More... | |
QLayoutItem * | takeAt (int index) |
Reimplemented Function More... | |
int | verticalSpacing () const |
the spacing between widgets that are laid out on top of each other More... | |
~QGridLayout () | |
Destroys the grid layout. More... | |
Public Functions inherited from QLayout | |
bool | activate () |
Redoes the layout for parentWidget() if necessary. More... | |
void | addWidget (QWidget *w) |
Adds widget w to this layout in a manner specific to the layout. More... | |
QMargins | contentsMargins () const |
Returns the margins used around the layout. More... | |
QRect | contentsRect () const |
Returns the layout's geometry() rectangle, but taking into account the contents margins. More... | |
Qt::Orientations | expandingDirections () const |
Returns whether this layout can make use of more space than sizeHint(). More... | |
QRect | geometry () const |
Reimplemented Function More... | |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const |
virtual int | indexOf (QWidget *) const |
Searches for widget widget in this layout (not including child layouts). More... | |
void | invalidate () |
Reimplemented Function More... | |
bool | isEmpty () const |
Reimplemented Function More... | |
bool | isEnabled () const |
Returns true if the layout is enabled; otherwise returns false. More... | |
QLayout * | layout () |
Reimplemented Function More... | |
int | margin () const |
QSize | maximumSize () const |
Returns the maximum size of this layout. More... | |
QWidget * | menuBar () const |
Returns the menu bar set for this layout, or 0 if no menu bar is set. More... | |
QSize | minimumSize () const |
Returns the minimum size of this layout. More... | |
QWidget * | parentWidget () const |
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget. More... | |
QLayout (QWidget *parent) | |
Constructs a new top-level QLayout, with parent parent. More... | |
QLayout () | |
Constructs a new child QLayout. More... | |
void | removeItem (QLayoutItem *) |
Removes the layout item item from the layout. More... | |
void | removeWidget (QWidget *w) |
Removes the widget widget from the layout. More... | |
bool | setAlignment (QWidget *w, Qt::Alignment alignment) |
Sets the alignment for widget w to alignment and returns true if w is found in this layout (not including child layouts); otherwise returns false. More... | |
bool | setAlignment (QLayout *l, Qt::Alignment alignment) |
Sets the alignment for the layout l to alignment and returns true if l is found in this layout (not including child layouts); otherwise returns false. More... | |
void | setContentsMargins (int left, int top, int right, int bottom) |
Sets the left, top, right, and bottom margins to use around the layout. More... | |
void | setContentsMargins (const QMargins &margins) |
Sets the margins to use around the layout. More... | |
void | setEnabled (bool) |
Enables this layout if enable is true, otherwise disables it. More... | |
void | setMargin (int) |
void | setMenuBar (QWidget *w) |
Tells the geometry manager to place the menu bar widget at the top of parentWidget(), outside QWidget::contentsMargins(). More... | |
void | setSizeConstraint (SizeConstraint) |
void | setSpacing (int) |
SizeConstraint | sizeConstraint () const |
int | spacing () const |
int | totalHeightForWidth (int w) const |
Also takes contentsMargins and menu bar into account. More... | |
QSize | totalMaximumSize () const |
Also takes contentsMargins and menu bar into account. More... | |
QSize | totalMinimumSize () const |
Also takes contentsMargins and menu bar into account. More... | |
QSize | totalSizeHint () const |
Also takes contentsMargins and menu bar into account. More... | |
void | update () |
Updates the layout for parentWidget(). More... | |
~QLayout () | |
Destroys the layout, deleting all child layouts. More... | |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Public Functions inherited from QLayoutItem | |
Qt::Alignment | alignment () const |
Returns the alignment of this item. More... | |
QSizePolicy::ControlTypes | controlTypes () const |
Returns the control type(s) for the layout item. More... | |
QLayoutItem (Qt::Alignment alignment=0) | |
Constructs a layout item with an alignment. More... | |
void | setAlignment (Qt::Alignment a) |
Sets the alignment of this item to alignment. More... | |
virtual QSpacerItem * | spacerItem () |
If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. More... | |
virtual QWidget * | widget () |
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. More... | |
virtual | ~QLayoutItem () |
Destroys the QLayoutItem. More... | |
Protected Functions | |
void | addItem (QLayoutItem *) |
Reimplemented Function More... | |
Protected Functions inherited from QLayout | |
void | addChildLayout (QLayout *l) |
This function is called from addLayout() or insertLayout() functions in subclasses to add layout l as a sub-layout. More... | |
void | addChildWidget (QWidget *w) |
This function is called from addWidget() functions in subclasses to add w as a managed widget of a layout. More... | |
bool | adoptLayout (QLayout *layout) |
QRect | alignmentRect (const QRect &) const |
Returns the rectangle that should be covered when the geometry of this layout is set to r, provided that this layout supports setAlignment(). More... | |
void | childEvent (QChildEvent *e) |
Reimplemented Function More... | |
QLayout (QLayoutPrivate &d, QLayout *, QWidget *) | |
void | widgetEvent (QEvent *) |
Performs child widget layout when the parent widget is resized. More... | |
Protected Functions inherited from QObject | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Additional Inherited Members | |
Public Types inherited from QLayout | |
enum | SizeConstraint { SetDefaultConstraint, SetNoConstraint, SetMinimumSize, SetFixedSize, SetMaximumSize, SetMinAndMaxSize } |
The possible values are: More... | |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Static Public Functions inherited from QLayout | |
static QSize | closestAcceptableSize (const QWidget *w, const QSize &s) |
Returns a size that satisfies all size constraints on widget, including heightForWidth() and that is as close as possible to size. More... | |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Protected Variables inherited from QLayoutItem | |
Qt::Alignment | align |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
The QGridLayout class lays out widgets in a grid.
QGridLayout takes the space made available to it (by its parent layout or by the parentWidget()), divides it up into rows and columns, and puts each widget it manages into the correct cell.
Columns and rows behave identically; we will discuss columns, but there are equivalent functions for rows.
Each column has a minimum width and a stretch factor. The minimum width is the greatest of that set using setColumnMinimumWidth() and the minimum width of each widget in that column. The stretch factor is set using setColumnStretch() and determines how much of the available space the column will get over and above its necessary minimum.
Normally, each managed widget or layout is put into a cell of its own using addWidget(). It is also possible for a widget to occupy multiple cells using the row and column spanning overloads of addItem() and addWidget(). If you do this, QGridLayout will guess how to distribute the size over the columns/rows (based on the stretch factors).
To remove a widget from a layout, call removeWidget(). Calling QWidget::hide() on a widget also effectively removes the widget from the layout until QWidget::show() is called.
This illustration shows a fragment of a dialog with a five-column, three-row grid (the grid is shown overlaid in magenta):
Columns 0, 2 and 4 in this dialog fragment are made up of a QLabel, a QLineEdit, and a QListBox. Columns 1 and 3 are placeholders made with setColumnMinimumWidth(). Row 0 consists of three QLabel objects, row 1 of three QLineEdit objects and row 2 of three QListBox objects. We used placeholder columns (1 and 3) to get the right amount of space between the columns.
Note that the columns and rows are not equally wide or tall. If you want two columns to have the same width, you must set their minimum widths and stretch factors to be the same yourself. You do this using setColumnMinimumWidth() and setColumnStretch().
If the QGridLayout is not the top-level layout (i.e. does not manage all of the widget's area and children), you must add it to its parent layout when you create it, but before you do anything with it. The normal way to add a layout is by calling addLayout() on the parent layout.
Once you have added your layout you can start putting widgets and other layouts into the cells of your grid layout using addWidget(), addItem(), and addLayout().
QGridLayout also includes two margin widths: the contents margin and the spacing(). The contents margin is the width of the reserved space along each of the QGridLayout's four sides. The spacing() is the width of the automatically allocated spacing between neighboring boxes.
The default contents margin values are provided by the style. The default value Qt styles specify is 9 for child widgets and 11 for windows. The spacing defaults to the same as the margin width for a top-level layout, or to the same as the parent layout.
Definition at line 60 of file qgridlayout.h.
|
explicit |
Constructs a new QGridLayout with parent widget, parent.
The layout has one row and one column initially, and will expand when new items are inserted.
Definition at line 1065 of file qgridlayout.cpp.
QGridLayout::QGridLayout | ( | ) |
Constructs a new grid layout.
You must insert this grid into another layout. You can insert widgets and layouts into this layout at any time, but laying out will not be performed before this is inserted into another layout.
Definition at line 1079 of file qgridlayout.cpp.
QGridLayout::~QGridLayout | ( | ) |
Destroys the grid layout.
Geometry management is terminated if this is a top-level grid.
The layout's widgets aren't destroyed.
Definition at line 1191 of file qgridlayout.cpp.
void QGridLayout::addItem | ( | QLayoutItem * | item, |
int | row, | ||
int | column, | ||
int | rowSpan = 1 , |
||
int | columnSpan = 1 , |
||
Qt::Alignment | alignment = 0 |
||
) |
Adds item at position row, column, spanning rowSpan rows and columnSpan columns, and aligns it according to alignment.
If rowSpan and/or columnSpan is -1, then the item will extend to the bottom and/or right edge, respectively. The layout takes ownership of the item.
Definition at line 1539 of file qgridlayout.cpp.
Referenced by addItem(), addWidget(), and QMainWindowPrivate::init().
|
protectedvirtual |
Reimplemented Function
Implements QLayout.
Definition at line 1521 of file qgridlayout.cpp.
void QGridLayout::addLayout | ( | QLayout * | layout, |
int | row, | ||
int | column, | ||
Qt::Alignment | alignment = 0 |
||
) |
Places the layout at position (row, column) in the grid.
The top-left position is (0, 0).
The alignment is specified by alignment. The default alignment is 0, which means that the widget fills the entire cell.
A non-zero alignment indicates that the layout should not grow to fill the available space but should be sized according to sizeHint().
layout becomes a child of the grid layout.
Definition at line 1636 of file qgridlayout.cpp.
void QGridLayout::addLayout | ( | QLayout * | layout, |
int | row, | ||
int | column, | ||
int | rowSpan, | ||
int | columnSpan, | ||
Qt::Alignment | alignment = 0 |
||
) |
This version adds the layout layout to the cell grid, spanning multiple rows/columns.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The cell will start at row, column spanning rowSpan rows and columnSpan columns.
If rowSpan and/or columnSpan is -1, then the layout will extend to the bottom and/or right edge, respectively.
Definition at line 1658 of file qgridlayout.cpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 116 of file qgridlayout.h.
Referenced by QFontDialogPrivate::init(), QMessageBoxPrivate::init(), QBalloonTip::QBalloonTip(), QColorShower::QColorShower(), QErrorMessage::QErrorMessage(), qt_mainwindow_layout(), QMessageBox::setDetailedText(), and QMessageBox::setInformativeText().
void QGridLayout::addWidget | ( | QWidget * | widget, |
int | row, | ||
int | column, | ||
Qt::Alignment | alignment = 0 |
||
) |
Adds the given widget to the cell grid at row, column.
The top-left position is (0, 0) by default.
The alignment is specified by alignment. The default alignment is 0, which means that the widget fills the entire cell.
Definition at line 1570 of file qgridlayout.cpp.
void QGridLayout::addWidget | ( | QWidget * | widget, |
int | fromRow, | ||
int | fromColumn, | ||
int | rowSpan, | ||
int | columnSpan, | ||
Qt::Alignment | alignment = 0 |
||
) |
This version adds the given widget to the cell grid, spanning multiple rows/columns.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The cell will start at fromRow, fromColumn spanning rowSpan rows and columnSpan columns. The widget will have the given alignment.
If rowSpan and/or columnSpan is -1, then the widget will extend to the bottom and/or right edge, respectively.
Definition at line 1600 of file qgridlayout.cpp.
QRect QGridLayout::cellRect | ( | int | row, |
int | column | ||
) | const |
Returns the geometry of the cell with row row and column column in the grid.
Returns an invalid rectangle if row or column is outside the grid.
Definition at line 1495 of file qgridlayout.cpp.
int QGridLayout::columnCount | ( | ) | const |
Returns the number of columns in this grid.
Definition at line 1300 of file qgridlayout.cpp.
Referenced by QMessageBox::setDetailedText().
int QGridLayout::columnMinimumWidth | ( | int | column | ) | const |
Returns the column spacing for column column.
Definition at line 1777 of file qgridlayout.cpp.
int QGridLayout::columnStretch | ( | int | column | ) | const |
Returns the stretch factor for column column.
Definition at line 1705 of file qgridlayout.cpp.
|
virtual |
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 1786 of file qgridlayout.cpp.
void QGridLayout::getItemPosition | ( | int | index, |
int * | row, | ||
int * | column, | ||
int * | rowSpan, | ||
int * | columnSpan | ||
) |
Returns the position information of the item with the given index.
The variables passed as row and column are updated with the position of the item in the layout, and the rowSpan and columnSpan variables are updated with the vertical and horizontal spans of the item.
Definition at line 1466 of file qgridlayout.cpp.
|
virtual |
Reimplemented Function
Reimplemented from QLayoutItem.
Definition at line 1354 of file qgridlayout.cpp.
|
virtual |
Reimplemented Function
Reimplemented from QLayoutItem.
Definition at line 1362 of file qgridlayout.cpp.
int QGridLayout::horizontalSpacing | ( | ) | const |
the spacing between widgets that are laid out side by side
If no value is explicitly set, the layout's horizontal spacing is inherited from the parent layout, or from the style settings for the parent widget.
Definition at line 1218 of file qgridlayout.cpp.
Referenced by expandingDirections(), hasHeightForWidth(), heightForWidth(), maximumSize(), minimumHeightForWidth(), minimumSize(), setGeometry(), sizeHint(), and spacing().
|
virtual |
Reimplemented Function
Reimplemented from QLayoutItem.
Definition at line 1819 of file qgridlayout.cpp.
Referenced by addItem(), addWidget(), setColumnMinimumWidth(), setColumnStretch(), setHorizontalSpacing(), setRowMinimumHeight(), setRowStretch(), setSpacing(), and setVerticalSpacing().
|
virtual |
QLayoutItem * QGridLayout::itemAtPosition | ( | int | row, |
int | column | ||
) | const |
Returns the layout item that occupies cell (row, column), or 0 if the cell is empty.
Definition at line 1434 of file qgridlayout.cpp.
Referenced by qt_mainwindow_layout().
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 1335 of file qgridlayout.cpp.
|
virtual |
Reimplemented Function
Reimplemented from QLayoutItem.
Definition at line 1372 of file qgridlayout.cpp.
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 1322 of file qgridlayout.cpp.
Qt::Corner QGridLayout::originCorner | ( | ) | const |
Returns the corner that's used for the grid's origin, i.e.
for position (0, 0).
Definition at line 1806 of file qgridlayout.cpp.
int QGridLayout::rowCount | ( | ) | const |
Returns the number of rows in this grid.
Definition at line 1291 of file qgridlayout.cpp.
Referenced by QMessageBox::setDetailedText().
int QGridLayout::rowMinimumHeight | ( | int | row | ) | const |
Returns the minimum width set for row row.
Definition at line 1754 of file qgridlayout.cpp.
int QGridLayout::rowStretch | ( | int | row | ) | const |
Returns the stretch factor for row row.
Definition at line 1694 of file qgridlayout.cpp.
void QGridLayout::setColumnMinimumWidth | ( | int | column, |
int | minSize | ||
) |
Sets the minimum width of column column to minSize pixels.
Definition at line 1765 of file qgridlayout.cpp.
Referenced by QFontDialogPrivate::init().
void QGridLayout::setColumnStretch | ( | int | column, |
int | stretch | ||
) |
Sets the stretch factor of column column to stretch.
The first column is number 0.
The stretch factor is relative to the other columns in this grid. Columns with a higher stretch factor take more of the available space.
The default stretch factor is 0. If the stretch factor is 0 and no other column in this table can grow at all, the column may still grow.
An alternative approach is to add spacing using addItem() with a QSpacerItem.
Definition at line 1728 of file qgridlayout.cpp.
Referenced by QFontDialogPrivate::init(), and QErrorMessage::QErrorMessage().
void QGridLayout::setDefaultPositioning | ( | int | n, |
Qt::Orientation | orient | ||
) |
Sets the positioning mode used by addItem(). If orient is Qt::Horizontal, this layout is expanded to n columns, and items will be added columns-first. Otherwise it is expanded to n rows and items will be added rows-first.
Definition at line 1172 of file qgridlayout.cpp.
|
virtual |
Reimplemented Function
Reimplemented from QLayout.
Definition at line 1476 of file qgridlayout.cpp.
void QGridLayout::setHorizontalSpacing | ( | int | spacing | ) |
Definition at line 1211 of file qgridlayout.cpp.
Referenced by QMessageBoxPrivate::init().
void QGridLayout::setOriginCorner | ( | Qt::Corner | corner | ) |
Sets the grid's origin corner, i.e.
position (0, 0), to corner.
Definition at line 1795 of file qgridlayout.cpp.
void QGridLayout::setRowMinimumHeight | ( | int | row, |
int | minSize | ||
) |
Sets the minimum height of row row to minSize pixels.
Definition at line 1742 of file qgridlayout.cpp.
Referenced by QFontDialogPrivate::init(), and QMessageBoxPrivate::init().
void QGridLayout::setRowStretch | ( | int | row, |
int | stretch | ||
) |
Sets the stretch factor of row row to stretch.
The first row is number 0.
The stretch factor is relative to the other rows in this grid. Rows with a higher stretch factor take more of the available space.
The default stretch factor is 0. If the stretch factor is 0 and no other row in this table can grow at all, the row may still grow.
Definition at line 1682 of file qgridlayout.cpp.
Referenced by QMessageBoxPrivate::init(), and QErrorMessage::QErrorMessage().
void QGridLayout::setSpacing | ( | int | spacing | ) |
This function sets both the vertical and horizontal spacing to spacing.
Definition at line 1265 of file qgridlayout.cpp.
Referenced by QFontDialogPrivate::init(), and QGridLayout().
void QGridLayout::setVerticalSpacing | ( | int | spacing | ) |
Definition at line 1242 of file qgridlayout.cpp.
Referenced by QMessageBoxPrivate::init().
|
virtual |
Reimplemented Function
Implements QLayoutItem.
Definition at line 1309 of file qgridlayout.cpp.
int QGridLayout::spacing | ( | ) | const |
If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwise it return -1.
Definition at line 1278 of file qgridlayout.cpp.
Referenced by QFontDialogPrivate::init(), QColorShower::QColorShower(), QGridLayout(), setHorizontalSpacing(), setSpacing(), and setVerticalSpacing().
|
virtual |
int QGridLayout::verticalSpacing | ( | ) | const |
the spacing between widgets that are laid out on top of each other
If no value is explicitly set, the layout's vertical spacing is inherited from the parent layout, or from the style settings for the parent widget.
Definition at line 1249 of file qgridlayout.cpp.
Referenced by expandingDirections(), hasHeightForWidth(), heightForWidth(), maximumSize(), minimumHeightForWidth(), minimumSize(), setGeometry(), sizeHint(), and spacing().