Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickLayoutAttached Class Reference

#include <qquicklayout_p.h>

+ Inheritance diagram for QQuickLayoutAttached:
+ Collaboration diagram for QQuickLayoutAttached:

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 ()
 
- Signals inherited from QObject
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
 
QQuickItemPrivateitemForSizePolicy (bool isFillSet) const
 
- Public Member Functions inherited from QObject
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< QStringbindableObjectName ()
 
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).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
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::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, 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 (QAnyStringView 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 >
findChild (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.
 
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 QObjectListchildren () 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< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () 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
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Friends

class QQuickLayout
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Static Public Member Functions inherited from QObject
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)
 
- Protected Member Functions inherited from QObject
QObjectsender () 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)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 160 of file qquicklayout_p.h.

Constructor & Destructor Documentation

◆ QQuickLayoutAttached()

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}.

Note
Do not bind to the x, y, width, or height properties of items in a layout, as this would conflict with the goals of Layout, and can also cause binding loops. The width and height properties are used by the layout engine to store the current size of items as calculated from the minimum/preferred/maximum attached properties, and can be ovewritten each time the items are laid out. Use \l {Layout::preferredWidth}{Layout.preferredWidth} and \l {Layout::preferredHeight}{Layout.preferredHeight}, or \l {Item::}{implicitWidth} and \l {Item::}{implicitHeight} to specify the preferred size of items.
See also
GridLayout
RowLayout
ColumnLayout

Definition at line 64 of file qquicklayout.cpp.

Member Function Documentation

◆ alignment()

Qt::Alignment QQuickLayoutAttached::alignment ( ) const
inline

Definition at line 243 of file qquicklayout_p.h.

◆ alignmentChanged

void QQuickLayoutAttached::alignmentChanged ( )
signal

Referenced by setAlignment().

+ Here is the caller graph for this function:

◆ bottomMargin()

qreal QQuickLayoutAttached::bottomMargin ( ) const
inline

Definition at line 273 of file qquicklayout_p.h.

◆ bottomMarginChanged

void QQuickLayoutAttached::bottomMarginChanged ( )
signal

Referenced by resetBottomMargin(), setBottomMargin(), and setMargins().

+ Here is the caller graph for this function:

◆ column()

int QQuickLayoutAttached::column ( ) const
inline

Definition at line 234 of file qquicklayout_p.h.

References qMax().

+ Here is the call graph for this function:

◆ columnChanged

void QQuickLayoutAttached::columnChanged ( )
signal

Referenced by setColumn().

+ Here is the caller graph for this function:

◆ columnSpan()

int QQuickLayoutAttached::columnSpan ( ) const
inline

Definition at line 240 of file qquicklayout_p.h.

◆ columnSpanChanged

void QQuickLayoutAttached::columnSpanChanged ( )
signal

Referenced by setColumnSpan().

+ Here is the caller graph for this function:

◆ effectiveQMargins()

QMarginsF QQuickLayoutAttached::effectiveQMargins ( ) const
inline

Definition at line 282 of file qquicklayout_p.h.

◆ fillHeight()

bool QQuickLayoutAttached::fillHeight ( ) const
inline

Definition at line 223 of file qquicklayout_p.h.

References QLayoutPolicy::Preferred.

◆ fillHeightChanged

void QQuickLayoutAttached::fillHeightChanged ( )
signal

Referenced by setFillHeight().

+ Here is the caller graph for this function:

◆ fillWidth()

bool QQuickLayoutAttached::fillWidth ( ) const
inline

Definition at line 215 of file qquicklayout_p.h.

References QLayoutPolicy::Preferred.

◆ fillWidthChanged

void QQuickLayoutAttached::fillWidthChanged ( )
signal

Referenced by setFillWidth().

+ Here is the caller graph for this function:

◆ horizontalStretchFactor()

int QQuickLayoutAttached::horizontalStretchFactor ( ) const
inline

Definition at line 247 of file qquicklayout_p.h.

◆ horizontalStretchFactorChanged

void QQuickLayoutAttached::horizontalStretchFactorChanged ( )
signal

Referenced by setHorizontalStretchFactor().

+ Here is the caller graph for this function:

◆ isAlignmentSet()

bool QQuickLayoutAttached::isAlignmentSet ( ) const
inline

Definition at line 245 of file qquicklayout_p.h.

◆ isBottomMarginSet()

bool QQuickLayoutAttached::isBottomMarginSet ( ) const
inline

Definition at line 276 of file qquicklayout_p.h.

◆ isColumnSet()

bool QQuickLayoutAttached::isColumnSet ( ) const
inline

Definition at line 236 of file qquicklayout_p.h.

◆ isExtentExplicitlySet()

bool QQuickLayoutAttached::isExtentExplicitlySet ( Qt::Orientation o,
Qt::SizeHint whichSize ) const
inline

◆ isFillHeightSet()

bool QQuickLayoutAttached::isFillHeightSet ( ) const
inline

Definition at line 229 of file qquicklayout_p.h.

◆ isFillWidthSet()

bool QQuickLayoutAttached::isFillWidthSet ( ) const
inline

Definition at line 221 of file qquicklayout_p.h.

◆ isHorizontalStretchFactorSet()

bool QQuickLayoutAttached::isHorizontalStretchFactorSet ( ) const
inline

Definition at line 249 of file qquicklayout_p.h.

◆ isLeftMarginSet()

bool QQuickLayoutAttached::isLeftMarginSet ( ) const
inline

Definition at line 261 of file qquicklayout_p.h.

◆ isMarginsSet()

bool QQuickLayoutAttached::isMarginsSet ( ) const
inline

Definition at line 256 of file qquicklayout_p.h.

◆ isMaximumHeightSet()

bool QQuickLayoutAttached::isMaximumHeightSet ( ) const
inline

Definition at line 210 of file qquicklayout_p.h.

◆ isMaximumWidthSet()

bool QQuickLayoutAttached::isMaximumWidthSet ( ) const
inline

Definition at line 206 of file qquicklayout_p.h.

◆ isMinimumHeightSet()

bool QQuickLayoutAttached::isMinimumHeightSet ( ) const
inline

Definition at line 194 of file qquicklayout_p.h.

◆ isMinimumWidthSet()

bool QQuickLayoutAttached::isMinimumWidthSet ( ) const
inline

Definition at line 190 of file qquicklayout_p.h.

◆ isPreferredHeightSet()

bool QQuickLayoutAttached::isPreferredHeightSet ( ) const
inline

Definition at line 202 of file qquicklayout_p.h.

◆ isPreferredWidthSet()

bool QQuickLayoutAttached::isPreferredWidthSet ( ) const
inline

Definition at line 198 of file qquicklayout_p.h.

◆ isRightMarginSet()

bool QQuickLayoutAttached::isRightMarginSet ( ) const
inline

Definition at line 271 of file qquicklayout_p.h.

◆ isRowSet()

bool QQuickLayoutAttached::isRowSet ( ) const
inline

Definition at line 233 of file qquicklayout_p.h.

◆ isTopMarginSet()

bool QQuickLayoutAttached::isTopMarginSet ( ) const
inline

Definition at line 266 of file qquicklayout_p.h.

◆ isVerticalStretchFactorSet()

bool QQuickLayoutAttached::isVerticalStretchFactorSet ( ) const
inline

Definition at line 252 of file qquicklayout_p.h.

◆ itemForSizePolicy()

QQuickItemPrivate * QQuickLayoutAttached::itemForSizePolicy ( bool isFillSet) const
inline

Definition at line 315 of file qquicklayout_p.h.

References Qt::AA_QtQuickUseDefaultSizePolicy, QQuickItemPrivate::get(), item, and QCoreApplication::testAttribute().

+ Here is the call graph for this function:

◆ leftMargin()

qreal QQuickLayoutAttached::leftMargin ( ) const
inline

Definition at line 258 of file qquicklayout_p.h.

◆ leftMarginChanged

void QQuickLayoutAttached::leftMarginChanged ( )
signal

Referenced by resetLeftMargin(), setLeftMargin(), and setMargins().

+ Here is the caller graph for this function:

◆ margins()

qreal QQuickLayoutAttached::margins ( ) const
inline

Definition at line 254 of file qquicklayout_p.h.

◆ marginsChanged

void QQuickLayoutAttached::marginsChanged ( )
signal

Referenced by setMargins().

+ Here is the caller graph for this function:

◆ maximumHeight()

qreal QQuickLayoutAttached::maximumHeight ( ) const
inline

Definition at line 208 of file qquicklayout_p.h.

References Qt::MaximumSize, and Qt::Vertical.

◆ maximumHeightChanged

void QQuickLayoutAttached::maximumHeightChanged ( )
signal

Referenced by setMaximumHeight(), and setMaximumImplicitSize().

+ Here is the caller graph for this function:

◆ maximumWidth()

qreal QQuickLayoutAttached::maximumWidth ( ) const
inline

Definition at line 204 of file qquicklayout_p.h.

References Qt::Horizontal, and Qt::MaximumSize.

◆ maximumWidthChanged

void QQuickLayoutAttached::maximumWidthChanged ( )
signal

Referenced by setMaximumImplicitSize(), and setMaximumWidth().

+ Here is the caller graph for this function:

◆ minimumHeight()

qreal QQuickLayoutAttached::minimumHeight ( ) const
inline

Definition at line 192 of file qquicklayout_p.h.

References Qt::MinimumSize, and Qt::Vertical.

◆ minimumHeightChanged

void QQuickLayoutAttached::minimumHeightChanged ( )
signal

Referenced by setMinimumHeight(), and setMinimumImplicitSize().

+ Here is the caller graph for this function:

◆ minimumWidth()

qreal QQuickLayoutAttached::minimumWidth ( ) const
inline

Definition at line 188 of file qquicklayout_p.h.

References Qt::Horizontal, and Qt::MinimumSize.

◆ minimumWidthChanged

void QQuickLayoutAttached::minimumWidthChanged ( )
signal

Referenced by setMinimumImplicitSize(), and setMinimumWidth().

+ Here is the caller graph for this function:

◆ preferredHeight()

qreal QQuickLayoutAttached::preferredHeight ( ) const
inline

Definition at line 200 of file qquicklayout_p.h.

◆ preferredHeightChanged

void QQuickLayoutAttached::preferredHeightChanged ( )
signal

Referenced by setPreferredHeight().

+ Here is the caller graph for this function:

◆ preferredWidth()

qreal QQuickLayoutAttached::preferredWidth ( ) const
inline

Definition at line 196 of file qquicklayout_p.h.

◆ preferredWidthChanged

void QQuickLayoutAttached::preferredWidthChanged ( )
signal

Referenced by setPreferredWidth().

+ Here is the caller graph for this function:

◆ qMargins()

QMarginsF QQuickLayoutAttached::qMargins ( ) const
inline

Definition at line 278 of file qquicklayout_p.h.

◆ resetBottomMargin()

void QQuickLayoutAttached::resetBottomMargin ( )

Definition at line 657 of file qquicklayout.cpp.

References QMarginsF::bottom(), bottomMarginChanged(), and emit.

+ Here is the call graph for this function:

◆ resetLeftMargin()

void QQuickLayoutAttached::resetLeftMargin ( )

Definition at line 564 of file qquicklayout.cpp.

References emit, QMarginsF::left(), and leftMarginChanged().

+ Here is the call graph for this function:

◆ resetRightMargin()

void QQuickLayoutAttached::resetRightMargin ( )

Definition at line 626 of file qquicklayout.cpp.

References emit, QMarginsF::right(), and rightMarginChanged().

+ Here is the call graph for this function:

◆ resetTopMargin()

void QQuickLayoutAttached::resetTopMargin ( )

Definition at line 595 of file qquicklayout.cpp.

References emit, QMarginsF::top(), and topMarginChanged().

+ Here is the call graph for this function:

◆ rightMargin()

qreal QQuickLayoutAttached::rightMargin ( ) const
inline

Definition at line 268 of file qquicklayout_p.h.

◆ rightMarginChanged

void QQuickLayoutAttached::rightMarginChanged ( )
signal

Referenced by resetRightMargin(), setMargins(), and setRightMargin().

+ Here is the caller graph for this function:

◆ row()

int QQuickLayoutAttached::row ( ) const
inline

Definition at line 231 of file qquicklayout_p.h.

References qMax().

+ Here is the call graph for this function:

◆ rowChanged

void QQuickLayoutAttached::rowChanged ( )
signal

Referenced by setRow().

+ Here is the caller graph for this function:

◆ rowSpan()

int QQuickLayoutAttached::rowSpan ( ) const
inline

Definition at line 238 of file qquicklayout_p.h.

◆ rowSpanChanged

void QQuickLayoutAttached::rowSpanChanged ( )
signal

Referenced by setRowSpan().

+ Here is the caller graph for this function:

◆ setAlignment()

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 408 of file qquicklayout.cpp.

References alignmentChanged(), emit, layout, and QLayout::setAlignment().

+ Here is the call graph for this function:

◆ setBottomMargin()

void QQuickLayoutAttached::setBottomMargin ( qreal m)

\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.

See also
margins
Since
QtQuick.Layouts 1.2

Definition at line 646 of file qquicklayout.cpp.

References bottomMargin, bottomMarginChanged(), emit, and QMarginsF::setBottom().

+ Here is the call graph for this function:

◆ setChangesNotificationEnabled()

bool QQuickLayoutAttached::setChangesNotificationEnabled ( bool enabled)
inline

Definition at line 290 of file qquicklayout_p.h.

References enabled.

◆ setColumn()

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.

See also
row
columnSpan

Definition at line 375 of file qquicklayout.cpp.

References column, columnChanged(), and emit.

+ Here is the call graph for this function:

◆ setColumnSpan()

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.

See also
rowSpan
column

Definition at line 698 of file qquicklayout.cpp.

References columnSpanChanged(), and emit.

+ Here is the call graph for this function:

◆ setFillHeight()

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 depends on implicit (built-in) size policy of the item.

See also
fillWidth

Definition at line 331 of file qquicklayout.cpp.

References emit, fill(), fillHeight, and fillHeightChanged().

+ Here is the call graph for this function:

◆ setFillWidth()

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 depends on implicit (built-in) size policy of item.

See also
fillHeight

Definition at line 310 of file qquicklayout.cpp.

References emit, fill(), fillWidth, and fillWidthChanged().

+ Here is the call graph for this function:

◆ setHorizontalStretchFactor()

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.

Note
This requires that Layout::fillWidth is set to true
Since
Qt 6.5
See also
verticalStretchFactor

Definition at line 446 of file qquicklayout.cpp.

References emit, Qt::Horizontal, horizontalStretchFactorChanged(), layout, and QBoxLayout::setStretchFactor().

+ Here is the call graph for this function:

◆ setLeftMargin()

void QQuickLayoutAttached::setLeftMargin ( qreal m)

\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.

See also
margins
Since
QtQuick.Layouts 1.2

Definition at line 553 of file qquicklayout.cpp.

References emit, leftMargin, leftMarginChanged(), and QMarginsF::setLeft().

+ Here is the call graph for this function:

◆ setMargins()

void QQuickLayoutAttached::setMargins ( qreal m)

\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.

See also
leftMargin
topMargin
rightMargin
bottomMargin
Since
QtQuick.Layouts 1.2

Definition at line 524 of file qquicklayout.cpp.

References QMarginsF::bottom(), bottomMarginChanged(), emit, QMarginsF::left(), leftMarginChanged(), marginsChanged(), QMarginsF::right(), rightMarginChanged(), QMarginsF::top(), and topMarginChanged().

+ Here is the call graph for this function:

◆ setMaximumHeight()

void QQuickLayoutAttached::setMaximumHeight ( qreal height)

\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.

See also
minimumHeight
preferredHeight

Definition at line 241 of file qquicklayout.cpp.

References emit, maximumHeightChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setMaximumImplicitSize()

void QQuickLayoutAttached::setMaximumImplicitSize ( const QSizeF & sz)

Definition at line 277 of file qquicklayout.cpp.

References emit, QSizeF::height(), maximumHeightChanged(), maximumWidthChanged(), and QSizeF::width().

+ Here is the call graph for this function:

◆ setMaximumWidth()

void QQuickLayoutAttached::setMaximumWidth ( qreal 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.

See also
minimumWidth
preferredWidth

Definition at line 214 of file qquicklayout.cpp.

References emit, maximumWidthChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setMinimumHeight()

void QQuickLayoutAttached::setMinimumHeight ( qreal height)

\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.

See also
preferredHeight
maximumHeight

Definition at line 144 of file qquicklayout.cpp.

References emit, minimumHeightChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setMinimumImplicitSize()

void QQuickLayoutAttached::setMinimumImplicitSize ( const QSizeF & sz)

Definition at line 254 of file qquicklayout.cpp.

References emit, QSizeF::height(), minimumHeightChanged(), minimumWidthChanged(), and QSizeF::width().

+ Here is the call graph for this function:

◆ setMinimumWidth()

void QQuickLayoutAttached::setMinimumWidth ( qreal 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.

See also
preferredWidth
maximumWidth

Definition at line 116 of file qquicklayout.cpp.

References emit, minimumWidthChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setPreferredHeight()

void QQuickLayoutAttached::setPreferredHeight ( qreal height)

\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.

See also
minimumHeight
maximumHeight

Definition at line 189 of file qquicklayout.cpp.

References emit, preferredHeightChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setPreferredWidth()

void QQuickLayoutAttached::setPreferredWidth ( qreal width)

\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.

See also
minimumWidth
maximumWidth

Definition at line 168 of file qquicklayout.cpp.

References emit, preferredWidthChanged(), and qt_is_nan().

+ Here is the call graph for this function:

◆ setRightMargin()

void QQuickLayoutAttached::setRightMargin ( qreal m)

\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.

See also
margins
Since
QtQuick.Layouts 1.2

Definition at line 615 of file qquicklayout.cpp.

References emit, rightMargin, rightMarginChanged(), and QMarginsF::setRight().

+ Here is the call graph for this function:

◆ setRow()

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.

See also
column
rowSpan

Definition at line 354 of file qquicklayout.cpp.

References emit, row, and rowChanged().

+ Here is the call graph for this function:

◆ setRowSpan()

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.

See also
columnSpan
row

Definition at line 678 of file qquicklayout.cpp.

References emit, and rowSpanChanged().

+ Here is the call graph for this function:

◆ setTopMargin()

void QQuickLayoutAttached::setTopMargin ( qreal m)

\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.

See also
margins
Since
QtQuick.Layouts 1.2

Definition at line 584 of file qquicklayout.cpp.

References emit, QMarginsF::setTop(), topMargin, and topMarginChanged().

+ Here is the call graph for this function:

◆ setVerticalStretchFactor()

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.

Note
This requires that Layout::fillHeight is set to true
Since
Qt 6.5
See also
horizontalStretchFactor

Definition at line 483 of file qquicklayout.cpp.

References emit, layout, QBoxLayout::setStretchFactor(), Qt::Vertical, and verticalStretchFactorChanged().

+ Here is the call graph for this function:

◆ sizeHint()

qreal QQuickLayoutAttached::sizeHint ( Qt::SizeHint which,
Qt::Orientation orientation ) const

Definition at line 708 of file qquicklayout.cpp.

References QSizeF::height(), Qt::Horizontal, layout, Qt::MaximumSize, QBoxLayout::sizeHint(), and QSizeF::width().

+ Here is the call graph for this function:

◆ topMargin()

qreal QQuickLayoutAttached::topMargin ( ) const
inline

Definition at line 263 of file qquicklayout_p.h.

◆ topMarginChanged

void QQuickLayoutAttached::topMarginChanged ( )
signal

Referenced by resetTopMargin(), setMargins(), and setTopMargin().

+ Here is the caller graph for this function:

◆ verticalStretchFactor()

int QQuickLayoutAttached::verticalStretchFactor ( ) const
inline

Definition at line 250 of file qquicklayout_p.h.

◆ verticalStretchFactorChanged

void QQuickLayoutAttached::verticalStretchFactorChanged ( )
signal

Referenced by setVerticalStretchFactor().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQuickLayout

friend class QQuickLayout
friend

Definition at line 390 of file qquicklayout_p.h.

Property Documentation

◆ alignment

Qt::Alignment QQuickLayoutAttached::alignment
readwrite

Definition at line 175 of file qquicklayout_p.h.

◆ bottomMargin

qreal QQuickLayoutAttached::bottomMargin
readwrite

Definition at line 183 of file qquicklayout_p.h.

Referenced by setBottomMargin().

◆ column

int QQuickLayoutAttached::column
readwrite

Definition at line 172 of file qquicklayout_p.h.

Referenced by setColumn().

◆ columnSpan

int QQuickLayoutAttached::columnSpan
readwrite

Definition at line 174 of file qquicklayout_p.h.

◆ fillHeight

bool QQuickLayoutAttached::fillHeight
readwrite

Definition at line 169 of file qquicklayout_p.h.

Referenced by setFillHeight().

◆ fillWidth

bool QQuickLayoutAttached::fillWidth
readwrite

Definition at line 170 of file qquicklayout_p.h.

Referenced by setFillWidth().

◆ horizontalStretchFactor

int QQuickLayoutAttached::horizontalStretchFactor
readwrite

Definition at line 176 of file qquicklayout_p.h.

◆ leftMargin

qreal QQuickLayoutAttached::leftMargin
readwrite

Definition at line 180 of file qquicklayout_p.h.

Referenced by setLeftMargin().

◆ margins

qreal QQuickLayoutAttached::margins
readwrite

Definition at line 179 of file qquicklayout_p.h.

◆ maximumHeight

qreal QQuickLayoutAttached::maximumHeight
readwrite

Definition at line 168 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ maximumWidth

qreal QQuickLayoutAttached::maximumWidth
readwrite

Definition at line 167 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ minimumHeight

qreal QQuickLayoutAttached::minimumHeight
readwrite

Definition at line 164 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ minimumWidth

qreal QQuickLayoutAttached::minimumWidth
readwrite

Definition at line 163 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ preferredHeight

qreal QQuickLayoutAttached::preferredHeight
readwrite

Definition at line 166 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ preferredWidth

qreal QQuickLayoutAttached::preferredWidth
readwrite

Definition at line 165 of file qquicklayout_p.h.

Referenced by QQuickLayout::effectiveSizeHints_helper().

◆ rightMargin

qreal QQuickLayoutAttached::rightMargin
readwrite

Definition at line 182 of file qquicklayout_p.h.

Referenced by setRightMargin().

◆ row

int QQuickLayoutAttached::row
readwrite

Definition at line 171 of file qquicklayout_p.h.

Referenced by setRow().

◆ rowSpan

int QQuickLayoutAttached::rowSpan
readwrite

Definition at line 173 of file qquicklayout_p.h.

◆ topMargin

qreal QQuickLayoutAttached::topMargin
readwrite

Definition at line 181 of file qquicklayout_p.h.

Referenced by setTopMargin().

◆ verticalStretchFactor

int QQuickLayoutAttached::verticalStretchFactor
readwrite

Definition at line 177 of file qquicklayout_p.h.


The documentation for this class was generated from the following files: