![]() |
Qt 6.x
The Qt SDK
|
#include <qquicklayout_p.h>
Signals | |
void | minimumWidthChanged () |
void | minimumHeightChanged () |
void | preferredWidthChanged () |
void | preferredHeightChanged () |
void | maximumWidthChanged () |
void | maximumHeightChanged () |
void | fillWidthChanged () |
void | fillHeightChanged () |
void | leftMarginChanged () |
void | topMarginChanged () |
void | rightMarginChanged () |
void | bottomMarginChanged () |
void | marginsChanged () |
void | rowChanged () |
void | columnChanged () |
void | rowSpanChanged () |
void | columnSpanChanged () |
void | alignmentChanged () |
void | horizontalStretchFactorChanged () |
void | verticalStretchFactorChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QQuickLayoutAttached (QObject *object) | |
Provides attached properties for items pushed onto a \l GridLayout, \l RowLayout or \l ColumnLayout. | |
qreal | minimumWidth () const |
void | setMinimumWidth (qreal width) |
\qmlattachedproperty real Layout::minimumWidth | |
bool | isMinimumWidthSet () const |
qreal | minimumHeight () const |
void | setMinimumHeight (qreal height) |
\qmlattachedproperty real Layout::minimumHeight | |
bool | isMinimumHeightSet () const |
qreal | preferredWidth () const |
void | setPreferredWidth (qreal width) |
\qmlattachedproperty real Layout::preferredWidth | |
bool | isPreferredWidthSet () const |
qreal | preferredHeight () const |
void | setPreferredHeight (qreal width) |
\qmlattachedproperty real Layout::preferredHeight | |
bool | isPreferredHeightSet () const |
qreal | maximumWidth () const |
void | setMaximumWidth (qreal width) |
\qmlattachedproperty real Layout::maximumWidth | |
bool | isMaximumWidthSet () const |
qreal | maximumHeight () const |
void | setMaximumHeight (qreal height) |
\qmlattachedproperty real Layout::maximumHeight | |
bool | isMaximumHeightSet () const |
void | setMinimumImplicitSize (const QSizeF &sz) |
void | setMaximumImplicitSize (const QSizeF &sz) |
bool | fillWidth () const |
void | setFillWidth (bool fill) |
\qmlattachedproperty bool Layout::fillWidth | |
bool | isFillWidthSet () const |
bool | fillHeight () const |
void | setFillHeight (bool fill) |
\qmlattachedproperty bool Layout::fillHeight | |
bool | isFillHeightSet () const |
int | row () const |
void | setRow (int row) |
\qmlattachedproperty int Layout::row | |
bool | isRowSet () const |
int | column () const |
void | setColumn (int column) |
\qmlattachedproperty int Layout::column | |
bool | isColumnSet () const |
int | rowSpan () const |
void | setRowSpan (int span) |
\qmlattachedproperty int Layout::rowSpan | |
int | columnSpan () const |
void | setColumnSpan (int span) |
\qmlattachedproperty int Layout::columnSpan | |
Qt::Alignment | alignment () const |
void | setAlignment (Qt::Alignment align) |
\qmlattachedproperty Qt.Alignment Layout::alignment | |
bool | isAlignmentSet () const |
int | horizontalStretchFactor () const |
void | setHorizontalStretchFactor (int stretchFactor) |
\qmlattachedproperty int Layout::horizontalStretchFactor | |
bool | isHorizontalStretchFactorSet () const |
int | verticalStretchFactor () const |
void | setVerticalStretchFactor (int stretchFactor) |
\qmlattachedproperty int Layout::verticalStretchFactor | |
bool | isVerticalStretchFactorSet () const |
qreal | margins () const |
void | setMargins (qreal m) |
\qmlattachedproperty real Layout::margins | |
bool | isMarginsSet () const |
qreal | leftMargin () const |
void | setLeftMargin (qreal m) |
\qmlattachedproperty real Layout::leftMargin | |
void | resetLeftMargin () |
bool | isLeftMarginSet () const |
qreal | topMargin () const |
void | setTopMargin (qreal m) |
\qmlattachedproperty real Layout::topMargin | |
void | resetTopMargin () |
bool | isTopMarginSet () const |
qreal | rightMargin () const |
void | setRightMargin (qreal m) |
\qmlattachedproperty real Layout::rightMargin | |
void | resetRightMargin () |
bool | isRightMarginSet () const |
qreal | bottomMargin () const |
void | setBottomMargin (qreal m) |
\qmlattachedproperty real Layout::bottomMargin | |
void | resetBottomMargin () |
bool | isBottomMarginSet () const |
QMarginsF | qMargins () const |
QMarginsF | effectiveQMargins () const |
bool | setChangesNotificationEnabled (bool enabled) |
qreal | sizeHint (Qt::SizeHint which, Qt::Orientation orientation) const |
bool | isExtentExplicitlySet (Qt::Orientation o, Qt::SizeHint whichSize) const |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) 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. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
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 . | |
Properties | |
qreal | minimumWidth |
qreal | minimumHeight |
qreal | preferredWidth |
qreal | preferredHeight |
qreal | maximumWidth |
qreal | maximumHeight |
bool | fillHeight |
bool | fillWidth |
int | row |
int | column |
int | rowSpan |
int | columnSpan |
Qt::Alignment | alignment |
int | horizontalStretchFactor |
int | verticalStretchFactor |
qreal | margins |
qreal | leftMargin |
qreal | topMargin |
qreal | rightMargin |
qreal | bottomMargin |
![]() | |
QString | objectName |
the name of this object | |
Friends | |
class | QQuickLayout |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
![]() | |
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 \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 159 of file qquicklayout_p.h.
QT_BEGIN_NAMESPACE QQuickLayoutAttached::QQuickLayoutAttached | ( | QObject * | parent | ) |
Provides attached properties for items pushed onto a \l GridLayout, \l RowLayout or \l ColumnLayout.
\qmltype Layout
! \instantiates QQuickLayoutAttached \inqmlmodule QtQuick.Layouts
An object of type Layout is attached to children of the layout to provide layout specific information about the item. The properties of the attached object influence how the layout will arrange the items.
For instance, you can specify \l minimumWidth, \l preferredWidth, and \l maximumWidth if the default values are not satisfactory.
When a layout is resized, items may grow or shrink. Due to this, items have a \l{Layout::minimumWidth}{minimum size}, \l{Layout::preferredWidth}{preferred size} and a \l{Layout::maximumWidth}{maximum size}.
If minimum size has not been explicitly specified on an item, the size is set to 0
. If maximum size has not been explicitly specified on an item, the size is set to Number.POSITIVE_INFINITY
.
For layouts, the implicit minimum and maximum sizes depend on the content of the layouts.
The \l fillWidth and \l fillHeight properties can either be true
or false
. If they are false
, the item's size will be fixed to its preferred size. Otherwise, it will grow or shrink between its minimum and maximum size as the layout is resized. If there are multiple items with \l fillWidth (or \l fillHeight) set to true
, the layout will grow or shrink the items relative to the ratio of their preferred size.
For more details on the layout algorithm, see also the \l {Qt Quick Layouts Overview}.
Definition at line 64 of file qquicklayout.cpp.
|
inline |
Definition at line 234 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 264 of file qquicklayout_p.h.
|
signal |
Referenced by resetBottomMargin(), setBottomMargin(), and setMargins().
|
inline |
Definition at line 225 of file qquicklayout_p.h.
References qMax().
|
signal |
|
inline |
Definition at line 231 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 273 of file qquicklayout_p.h.
|
inline |
Definition at line 218 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 214 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 238 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 236 of file qquicklayout_p.h.
|
inline |
Definition at line 267 of file qquicklayout_p.h.
|
inline |
Definition at line 227 of file qquicklayout_p.h.
|
inline |
Definition at line 290 of file qquicklayout_p.h.
References Qt::Horizontal, Qt::MaximumSize, Qt::MinimumDescent, Qt::MinimumSize, Qt::NSizeHints, o, and Qt::PreferredSize.
|
inline |
Definition at line 220 of file qquicklayout_p.h.
|
inline |
Definition at line 216 of file qquicklayout_p.h.
|
inline |
Definition at line 240 of file qquicklayout_p.h.
|
inline |
Definition at line 252 of file qquicklayout_p.h.
|
inline |
Definition at line 247 of file qquicklayout_p.h.
|
inline |
Definition at line 209 of file qquicklayout_p.h.
|
inline |
Definition at line 205 of file qquicklayout_p.h.
|
inline |
Definition at line 193 of file qquicklayout_p.h.
|
inline |
Definition at line 189 of file qquicklayout_p.h.
|
inline |
Definition at line 201 of file qquicklayout_p.h.
|
inline |
Definition at line 197 of file qquicklayout_p.h.
|
inline |
Definition at line 262 of file qquicklayout_p.h.
|
inline |
Definition at line 224 of file qquicklayout_p.h.
|
inline |
Definition at line 257 of file qquicklayout_p.h.
|
inline |
Definition at line 243 of file qquicklayout_p.h.
|
inline |
Definition at line 249 of file qquicklayout_p.h.
|
signal |
Referenced by resetLeftMargin(), setLeftMargin(), and setMargins().
|
inline |
Definition at line 245 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 207 of file qquicklayout_p.h.
References Qt::MaximumSize, and Qt::Vertical.
|
signal |
Referenced by setMaximumHeight(), and setMaximumImplicitSize().
|
inline |
Definition at line 203 of file qquicklayout_p.h.
References Qt::Horizontal, and Qt::MaximumSize.
|
signal |
Referenced by setMaximumImplicitSize(), and setMaximumWidth().
|
inline |
Definition at line 191 of file qquicklayout_p.h.
References Qt::MinimumSize, and Qt::Vertical.
|
signal |
Referenced by setMinimumHeight(), and setMinimumImplicitSize().
|
inline |
Definition at line 187 of file qquicklayout_p.h.
References Qt::Horizontal, and Qt::MinimumSize.
|
signal |
Referenced by setMinimumImplicitSize(), and setMinimumWidth().
|
inline |
Definition at line 199 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 195 of file qquicklayout_p.h.
|
signal |
|
inline |
Definition at line 269 of file qquicklayout_p.h.
void QQuickLayoutAttached::resetBottomMargin | ( | ) |
Definition at line 655 of file qquicklayout.cpp.
References QMarginsF::bottom(), bottomMarginChanged(), and emit.
void QQuickLayoutAttached::resetLeftMargin | ( | ) |
Definition at line 562 of file qquicklayout.cpp.
References emit, QMarginsF::left(), and leftMarginChanged().
void QQuickLayoutAttached::resetRightMargin | ( | ) |
Definition at line 624 of file qquicklayout.cpp.
References emit, QMarginsF::right(), and rightMarginChanged().
void QQuickLayoutAttached::resetTopMargin | ( | ) |
Definition at line 593 of file qquicklayout.cpp.
References emit, QMarginsF::top(), and topMarginChanged().
|
inline |
Definition at line 259 of file qquicklayout_p.h.
|
signal |
Referenced by resetRightMargin(), setMargins(), and setRightMargin().
|
inline |
Definition at line 222 of file qquicklayout_p.h.
References qMax().
|
signal |
|
inline |
Definition at line 229 of file qquicklayout_p.h.
|
signal |
void QQuickLayoutAttached::setAlignment | ( | Qt::Alignment | align | ) |
\qmlattachedproperty Qt.Alignment Layout::alignment
This property allows you to specify the alignment of an item within the cell(s) it occupies.
The default value is 0
, which means it will be {Qt.AlignVCenter | Qt.AlignLeft}. These defaults also apply if only a horizontal or vertical flag is specified: if only a horizontal flag is specified, the default vertical flag will be
Qt.AlignVCenter
, and if only a vertical flag is specified, the default horizontal flag will be Qt.AlignLeft
.
A valid alignment is a combination of the following flags: \list
Definition at line 406 of file qquicklayout.cpp.
References alignmentChanged(), emit, layout, and QLayout::setAlignment().
\qmlattachedproperty real Layout::bottomMargin
Specifies the bottom margin outside of an item. If the value is not set, it will use the value from \l margins.
Definition at line 644 of file qquicklayout.cpp.
References bottomMargin, bottomMarginChanged(), emit, and QMarginsF::setBottom().
|
inline |
Definition at line 281 of file qquicklayout_p.h.
References QQuickItem::enabled.
void QQuickLayoutAttached::setColumn | ( | int | column | ) |
\qmlattachedproperty int Layout::column
This property allows you to specify the column position of an item in a \l GridLayout.
If both \l row and this property are not set, it is up to the layout to assign a cell to the item.
The default value is 0
.
Definition at line 373 of file qquicklayout.cpp.
References column, columnChanged(), and emit.
void QQuickLayoutAttached::setColumnSpan | ( | int | span | ) |
\qmlattachedproperty int Layout::columnSpan
This property allows you to specify the column span of an item in a \l GridLayout.
The default value is 1
.
Definition at line 696 of file qquicklayout.cpp.
References columnSpanChanged(), and emit.
void QQuickLayoutAttached::setFillHeight | ( | bool | fill | ) |
\qmlattachedproperty bool Layout::fillHeight
If this property is true
, the item will be as tall as possible while respecting the given constraints. If the property is false
, the item will have a fixed height set to the preferred height. The default is false
, except for layouts themselves, which default to true
.
Definition at line 330 of file qquicklayout.cpp.
References emit, fill(), and fillHeightChanged().
void QQuickLayoutAttached::setFillWidth | ( | bool | fill | ) |
\qmlattachedproperty bool Layout::fillWidth
If this property is true
, the item will be as wide as possible while respecting the given constraints. If the property is false
, the item will have a fixed width set to the preferred width. The default is false
, except for layouts themselves, which default to true
.
Definition at line 310 of file qquicklayout.cpp.
References emit, fill(), and fillWidthChanged().
void QQuickLayoutAttached::setHorizontalStretchFactor | ( | int | factor | ) |
\qmlattachedproperty int Layout::horizontalStretchFactor
This property allows you to specify the horizontal stretch factor. By default, two identical items arranged in a linear layout will have the same size, but if the first item has a stretch factor of 1 and the second item has a stretch factor of 2, the first item will aim to get 1/3 of the available space, and the second will aim to get 2/3 of the available space. Note that, whether they become exactly 1/3 and 2/3 of the available space depends on their size hints. This is because when e.g a horizontal layout is shown in its minimum width all its child items will consequently also have their minimum width.
Likewise, when a horizontal layout has its preferred width, all child items will have their preferred widths, and when a horizontal layout has its maximum width, all child items will have their maximum widths. This strategy is applied regardless of what the individual stretch factors are. As a consequence of this, stretch factors will only determine the growth rate of child items between the preferredWidth and maximumWidth range.
The default value is -1
, which means that no stretch factor is applied.
Definition at line 444 of file qquicklayout.cpp.
References emit, Qt::Horizontal, horizontalStretchFactorChanged(), layout, and QBoxLayout::setStretchFactor().
\qmlattachedproperty real Layout::leftMargin
Specifies the left margin outside of an item. If the value is not set, it will use the value from \l margins.
Definition at line 551 of file qquicklayout.cpp.
References emit, leftMargin, leftMarginChanged(), and QMarginsF::setLeft().
\qmlattachedproperty real Layout::margins
Sets the margins outside of an item to all have the same value. The item itself does not evaluate its own margins. It is the parent's responsibility to decide if it wants to evaluate the margins.
Specifically, margins are only evaluated by ColumnLayout, RowLayout, GridLayout, and other layout-like containers, such as SplitView, where the effective cell size of an item will be increased as the margins are increased.
Therefore, if an item with margins is a child of another Item
, its position, size and implicit size will remain unchanged.
Combining margins with alignment will align the item including its margins. For instance, a vertically-centered Item with a top margin of 1
and a bottom margin of 9
will cause the Items effective alignment within the cell to be 4 pixels above the center.
The default value is 0
.
Definition at line 522 of file qquicklayout.cpp.
References QMarginsF::bottom(), bottomMarginChanged(), emit, QMarginsF::left(), leftMarginChanged(), marginsChanged(), QMarginsF::right(), rightMarginChanged(), QMarginsF::top(), and topMarginChanged().
\qmlattachedproperty real Layout::maximumHeight
The default value is the item's implicit maximum height.
If the item is a layout, the implicit maximum height will be the maximum height the layout can have without any of its items growing beyond their maximum height. The implicit maximum height for any other item is Number.POSITIVE_INFINITY
.
Setting this value to -1
will reset the height back to its implicit maximum height.
Definition at line 241 of file qquicklayout.cpp.
References emit, maximumHeightChanged(), and qt_is_nan().
Definition at line 277 of file qquicklayout.cpp.
References emit, QSizeF::height(), maximumHeightChanged(), maximumWidthChanged(), and QSizeF::width().
\qmlattachedproperty real Layout::maximumWidth
This property holds the maximum width of an item in a layout. The default value is the item's implicit maximum width.
If the item is a layout, the implicit maximum width will be the maximum width the layout can have without any of its items growing beyond their maximum width. The implicit maximum width for any other item is Number.POSITIVE_INFINITY
.
Setting this value to -1
will reset the width back to its implicit maximum width.
Definition at line 214 of file qquicklayout.cpp.
References emit, maximumWidthChanged(), and qt_is_nan().
\qmlattachedproperty real Layout::minimumHeight
This property holds the minimum height of an item in a layout. The default value is the item's implicit minimum height.
If the item is a layout, the implicit minimum height will be the minimum height the layout can have without any of its items shrinking below their minimum height. The implicit minimum height for any other item is 0
.
Setting this value to -1 will reset the height back to its implicit minimum height.
Definition at line 144 of file qquicklayout.cpp.
References emit, minimumHeightChanged(), and qt_is_nan().
Definition at line 254 of file qquicklayout.cpp.
References emit, QSizeF::height(), minimumHeightChanged(), minimumWidthChanged(), and QSizeF::width().
\qmlattachedproperty real Layout::minimumWidth
This property holds the minimum width of an item in a layout. The default value is the item's implicit minimum width.
If the item is a layout, the implicit minimum width will be the minimum width the layout can have without any of its items shrinking below their minimum width. The implicit minimum width for any other item is 0
.
Setting this value to -1 will reset the width back to its implicit minimum width.
Definition at line 116 of file qquicklayout.cpp.
References emit, minimumWidthChanged(), and qt_is_nan().
\qmlattachedproperty real Layout::preferredHeight
This property holds the preferred height of an item in a layout. If the preferred height is -1
it will be ignored, and the layout will use \l{Item::implicitHeight}{implicitHeight} instead. The default is -1
.
Definition at line 189 of file qquicklayout.cpp.
References emit, preferredHeightChanged(), and qt_is_nan().
\qmlattachedproperty real Layout::preferredWidth
This property holds the preferred width of an item in a layout. If the preferred width is -1
it will be ignored, and the layout will use \l{Item::implicitWidth}{implicitWidth} instead. The default is -1
.
Definition at line 168 of file qquicklayout.cpp.
References emit, preferredWidthChanged(), and qt_is_nan().
\qmlattachedproperty real Layout::rightMargin
Specifies the right margin outside of an item. If the value is not set, it will use the value from \l margins.
Definition at line 613 of file qquicklayout.cpp.
References emit, rightMargin, rightMarginChanged(), and QMarginsF::setRight().
void QQuickLayoutAttached::setRow | ( | int | row | ) |
\qmlattachedproperty int Layout::row
This property allows you to specify the row position of an item in a \l GridLayout.
If both \l column and this property are not set, it is up to the layout to assign a cell to the item.
The default value is 0
.
Definition at line 352 of file qquicklayout.cpp.
References emit, row, and rowChanged().
void QQuickLayoutAttached::setRowSpan | ( | int | span | ) |
\qmlattachedproperty int Layout::rowSpan
This property allows you to specify the row span of an item in a \l GridLayout.
The default value is 1
.
Definition at line 676 of file qquicklayout.cpp.
References emit, and rowSpanChanged().
\qmlattachedproperty real Layout::topMargin
Specifies the top margin outside of an item. If the value is not set, it will use the value from \l margins.
Definition at line 582 of file qquicklayout.cpp.
References emit, QMarginsF::setTop(), topMargin, and topMarginChanged().
void QQuickLayoutAttached::setVerticalStretchFactor | ( | int | factor | ) |
\qmlattachedproperty int Layout::verticalStretchFactor
This property allows you to specify the vertical stretch factor. By default, two identical items arranged in a linear layout will have the same size, but if the first item has a stretch factor of 1 and the second item has a stretch factor of 2, the first item will aim to get 1/3 of the available space, and the second will aim to get 2/3 of the available space. Note that, whether they become exactly 1/3 and 2/3 of the available space depends on their size hints. This is because when e.g a vertical layout is shown in its minimum height all its child items will consequently also have their minimum height.
Likewise, when a vertical layout has its preferred height, all child items will have their preferred heights, and when a vertical layout has its maximum height, all child items will have their maximum heights. This strategy is applied regardless of what the individual stretch factors are. As a consequence of this, stretch factors will only determine the growth rate of child items between the preferredHeight and maximumHeight range.
The default value is -1
, which means that no stretch factor is applied.
Definition at line 481 of file qquicklayout.cpp.
References emit, layout, QBoxLayout::setStretchFactor(), Qt::Vertical, and verticalStretchFactorChanged().
qreal QQuickLayoutAttached::sizeHint | ( | Qt::SizeHint | which, |
Qt::Orientation | orientation | ||
) | const |
Definition at line 706 of file qquicklayout.cpp.
References QSizeF::height(), Qt::Horizontal, layout, Qt::MaximumSize, QBoxLayout::sizeHint(), and QSizeF::width().
|
inline |
Definition at line 254 of file qquicklayout_p.h.
|
signal |
Referenced by resetTopMargin(), setMargins(), and setTopMargin().
|
inline |
Definition at line 241 of file qquicklayout_p.h.
|
signal |
|
friend |
Definition at line 372 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setBottomMargin().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setColumn().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setLeftMargin().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by QQuickLayout::effectiveSizeHints_helper().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setRightMargin().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setRow().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.
Referenced by setTopMargin().
|
readwrite |
Definition at line 155 of file qquicklayout_p.h.