Padding

Search for usage in LXR

#include <padding.h>

Inheritance diagram for Padding:

Properties

qreal availableHeight
 
qreal availableWidth
 
qreal bottomPadding
 
QML_ELEMENTQQuickItem * contentItem
 
qreal horizontalPadding
 
qreal implicitContentHeight
 
qreal implicitContentWidth
 
qreal leftPadding
 
qreal padding
 
qreal rightPadding
 
qreal topPadding
 
qreal verticalPadding
 
- Properties inherited from QQuickItem
 activeFocus
 
 activeFocusOnTab
 
 antialiasing
 
 baselineOffset
 
 childrenRect
 
 clip
 
 containmentMask
 
 enabled
 
 focus
 
 height
 
 implicitHeight
 
 implicitWidth
 
 opacity
 
 parent
 
 rotation
 
 scale
 
 smooth
 
 state
 
 transformOrigin
 
 visible
 
 width
 
 x
 
 y
 
 z
 
- Properties inherited from QObject
 objectName
 

Signals

void availableHeightChanged ()
 
void availableWidthChanged ()
 
void bottomPaddingChanged ()
 
void contentItemChanged ()
 
void horizontalPaddingChanged ()
 
void implicitContentHeightChanged ()
 
void implicitContentWidthChanged ()
 
void leftPaddingChanged ()
 
void paddingChanged ()
 
void rightPaddingChanged ()
 
void topPaddingChanged ()
 
void verticalPaddingChanged ()
 

Public Member Functions

 Padding (QQuickItem *parent=nullptr)
 
qreal availableHeight () const
 
qreal availableWidth () const
 
qreal bottomPadding () const
 
QQuickItemcontentItem ()
 
qreal horizontalPadding () const
 
qreal implicitContentHeight () const
 
qreal implicitContentWidth () const
 
qreal leftPadding () const
 
qreal padding () const
 
void resetBottomPadding ()
 
void resetHorizontalPadding ()
 
void resetLeftPadding ()
 
void resetPadding ()
 
void resetRightPadding ()
 
void resetTopPadding ()
 
void resetVerticalPadding ()
 
qreal rightPadding () const
 
void setBottomPadding (qreal padding)
 
void setContentItem (QQuickItem *item)
 
void setHorizontalPadding (qreal padding)
 
void setLeftPadding (qreal padding)
 
void setPadding (qreal padding)
 
void setRightPadding (qreal padding)
 
void setTopPadding (qreal padding)
 
void setVerticalPadding (qreal padding)
 
qreal topPadding () const
 
qreal verticalPadding () const
 
- Public Member Functions inherited from QQuickItem
 QQuickItem (QQuickItem *parent)
 
Qt::MouseButtons acceptedMouseButtons () const const
 
bool acceptHoverEvents () const const
 
bool acceptTouchEvents () const const
 
void activeFocusChanged (bool)
 
bool activeFocusOnTab () const const
 
void activeFocusOnTabChanged (bool)
 
bool antialiasing () const const
 
void antialiasingChanged (bool)
 
qreal baselineOffset () const const
 
void baselineOffsetChanged (qreal)
 
QBindable< qreal > bindableHeight ()
 
QBindable< qreal > bindableWidth ()
 
QBindable< qreal > bindableX ()
 
QBindable< qreal > bindableY ()
 
virtual QRectF boundingRect () const const
 
QQuickItemchildAt (qreal x, qreal y) const const
 
QList< QQuickItem * > childItems () const const
 
QRectF childrenRect ()
 
void childrenRectChanged (const QRectF &)
 
bool clip () const const
 
void clipChanged (bool)
 
virtual QRectF clipRect () const const
 
QObjectcontainmentMask () const const
 
void containmentMaskChanged ()
 
virtual bool contains (const QPointF &point) const const
 
QCursor cursor () const const
 
void dumpItemTree () const const
 
void enabledChanged ()
 
void ensurePolished ()
 
bool filtersChildMouseEvents () const const
 
Flags flags () const const
 
void focusChanged (bool)
 
void forceActiveFocus ()
 
void forceActiveFocus (Qt::FocusReason reason)
 
void grabMouse ()
 
QSharedPointer< QQuickItemGrabResultgrabToImage (const QSize &targetSize)
 
void grabTouchPoints (const QList< int > &ids)
 
bool hasActiveFocus () const const
 
bool hasFocus () const const
 
qreal height () const const
 
void heightChanged ()
 
qreal implicitHeight () const const
 
void implicitHeightChanged ()
 
qreal implicitWidth () const const
 
void implicitWidthChanged ()
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const const
 
bool isAncestorOf (const QQuickItem *child) const const
 
bool isEnabled () const const
 
bool isFocusScope () const const
 
virtual bool isTextureProvider () const const
 
bool isVisible () const const
 
bool keepMouseGrab () const const
 
bool keepTouchGrab () const const
 
QPointF mapFromGlobal (const QPointF &point) const const
 
QPointF mapFromItem (const QQuickItem *item, const QPointF &point) const const
 
QPointF mapFromScene (const QPointF &point) const const
 
QRectF mapRectFromItem (const QQuickItem *item, const QRectF &rect) const const
 
QRectF mapRectFromScene (const QRectF &rect) const const
 
QRectF mapRectToItem (const QQuickItem *item, const QRectF &rect) const const
 
QRectF mapRectToScene (const QRectF &rect) const const
 
QPointF mapToGlobal (const QPointF &point) const const
 
QPointF mapToItem (const QQuickItem *item, const QPointF &point) const const
 
QPointF mapToScene (const QPointF &point) const const
 
QQuickItemnextItemInFocusChain (bool forward)
 
qreal opacity () const const
 
void opacityChanged ()
 
void parentChanged (QQuickItem *)
 
QQuickItemparentItem () const const
 
void polish ()
 
void resetAntialiasing ()
 
void resetHeight ()
 
void resetWidth ()
 
qreal rotation () const const
 
void rotationChanged ()
 
qreal scale () const const
 
void scaleChanged ()
 
QQuickItemscopedFocusItem () const const
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 
void setAcceptHoverEvents (bool enabled)
 
void setAcceptTouchEvents (bool enabled)
 
void setActiveFocusOnTab (bool)
 
void setAntialiasing (bool)
 
void setBaselineOffset (qreal)
 
void setClip (bool)
 
void setContainmentMask (QObject *mask)
 
void setCursor (const QCursor &cursor)
 
void setEnabled (bool)
 
void setFiltersChildMouseEvents (bool filter)
 
void setFlag (Flag flag, bool enabled)
 
void setFlags (Flags flags)
 
void setFocus (bool focus, Qt::FocusReason reason)
 
void setFocus (bool)
 
void setHeight (qreal)
 
void setImplicitHeight (qreal)
 
void setImplicitWidth (qreal)
 
void setKeepMouseGrab (bool keep)
 
void setKeepTouchGrab (bool keep)
 
void setOpacity (qreal)
 
void setParentItem (QQuickItem *parent)
 
void setRotation (qreal)
 
void setScale (qreal)
 
void setSize (const QSizeF &size)
 
void setSmooth (bool)
 
void setState (const QString &)
 
void setTransformOrigin (TransformOrigin)
 
void setVisible (bool)
 
void setWidth (qreal)
 
void setX (qreal)
 
void setY (qreal)
 
void setZ (qreal)
 
QSizeF size () const const
 
bool smooth () const const
 
void smoothChanged (bool)
 
void stackAfter (const QQuickItem *sibling)
 
void stackBefore (const QQuickItem *sibling)
 
QString state () const const
 
void stateChanged (const QString &)
 
virtual QSGTextureProvidertextureProvider () const const
 
TransformOrigin transformOrigin () const const
 
void transformOriginChanged (TransformOrigin)
 
void ungrabMouse ()
 
void ungrabTouchPoints ()
 
void unsetCursor ()
 
void update ()
 
QQuickItemviewportItem () const const
 
void visibleChanged ()
 
qreal width () const const
 
void widthChanged ()
 
QQuickWindowwindow () const const
 
void windowChanged (QQuickWindow *window)
 
qreal x () const const
 
void xChanged ()
 
qreal y () const const
 
void yChanged ()
 
qreal z () const const
 
void zChanged ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from QQmlParserStatus

Protected Member Functions

void componentComplete () override
 
void geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) override
 
void updatePolish () override
 
- Protected Member Functions inherited from QQuickItem
virtual bool childMouseEventFilter (QQuickItem *item, QEvent *event)
 
virtual void classBegin () override
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual bool event (QEvent *ev) override
 
virtual void focusInEvent (QFocusEvent *)
 
virtual void focusOutEvent (QFocusEvent *)
 
bool heightValid () const const
 
virtual void hoverEnterEvent (QHoverEvent *event)
 
virtual void hoverLeaveEvent (QHoverEvent *event)
 
virtual void hoverMoveEvent (QHoverEvent *event)
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
bool isComponentComplete () const const
 
virtual void itemChange (ItemChange change, const ItemChangeData &value)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void mouseUngrabEvent ()
 
virtual void releaseResources ()
 
virtual void touchEvent (QTouchEvent *event)
 
virtual void touchUngrabEvent ()
 
void updateInputMethod (Qt::InputMethodQueries queries)
 
virtual QSGNodeupdatePaintNode (QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
 
virtual void wheelEvent (QWheelEvent *event)
 
bool widthValid () const const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Types inherited from QQuickItem
enum  Flag
 
typedef  Flags
 
enum  ItemChange
 
enum  TransformOrigin
 
- Public Types inherited from QObject
typedef  QObjectList
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QQuickItem
 Bottom
 
 BottomLeft
 
 BottomRight
 
 Center
 
 ItemAcceptsDrops
 
 ItemAcceptsInputMethod
 
 ItemActiveFocusHasChanged
 
 ItemAntialiasingHasChanged
 
 ItemChildAddedChange
 
 ItemChildRemovedChange
 
 ItemClipsChildrenToShape
 
 ItemDevicePixelRatioHasChanged
 
 ItemEnabledHasChanged
 
 ItemHasContents
 
 ItemIsFocusScope
 
 ItemIsViewport
 
 ItemObservesViewport
 
 ItemOpacityHasChanged
 
 ItemParentHasChanged
 
 ItemRotationHasChanged
 
 ItemSceneChange
 
 ItemVisibleHasChanged
 
 Left
 
 Right
 
 Top
 
 TopLeft
 
 TopRight
 

Detailed Description

This item simply adds an external padding to contentItem's size.

Padding item behaves similarly to QtQuick.Controls/Controlpadding, but is more lightweight and thus efficient. Its implicit size is set to that of its contentItem's implicit size plus padding.

import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
Kirigami.Padding {
padding: Kirigami.Units.largeSpacing
contentItem: QQC2.Button {}
}

With this component it is possible to add external paddings as a placeholder for an item, whereas with QtQuick.Layouts you would need to manually assign or bind attached properties whenever content item changes.

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
ColumnLayout {
property alias contentItem: container.contentItem
Kirigami.Heading {
Layout.fillWidth: true
Layout.margins: Kirigami.Units.largeSpacing
}
Kirigami.Padding {
id: container
Layout.fillWidth: true
padding: Kirigami.Units.largeSpacing
}
}
Since
KDE Frameworks 6.0

Definition at line 60 of file padding.h.

Property Documentation

◆ availableHeight

qreal Padding::availableHeight
read

The height available to the contentItem after deducting vertical padding from the width of the Padding.

Definition at line 136 of file padding.h.

◆ availableWidth

qreal Padding::availableWidth
read

The width available to the contentItem after deducting horizontal padding from the width of the Padding.

Definition at line 131 of file padding.h.

◆ bottomPadding

qreal Padding::bottomPadding
readwrite

This property holds the padding on the bottom side.

Unless explicitly set, it falls back to verticalPadding and then to padding.

Definition at line 126 of file padding.h.

◆ contentItem

QQuickItem * Padding::contentItem
readwrite

This property holds the visual content Item.

It will automatically resized taking into account all the paddings

Definition at line 70 of file padding.h.

◆ horizontalPadding

qreal Padding::horizontalPadding
readwrite

This property holds the horizontal padding.

Unless explicitly set, the value is equal to padding.

Definition at line 89 of file padding.h.

◆ implicitContentHeight

qreal Padding::implicitContentHeight
read

The implicitHeight of its contentItem, or 0 if not present.

Definition at line 146 of file padding.h.

◆ implicitContentWidth

qreal Padding::implicitContentWidth
read

The implicitWidth of its contentItem, or 0 if not present.

Definition at line 141 of file padding.h.

◆ leftPadding

qreal Padding::leftPadding
readwrite

This property holds the padding on the left side.

Unless explicitly set, it falls back to horizontalPadding and then to padding. This always refers to the actual left, it won't be flipped on RTL layouts.

Definition at line 104 of file padding.h.

◆ padding

qreal Padding::padding
readwrite

This property holds the default padding.

Padding adds a space between each edge of this ITem and its contentItem, effectively controlling its size. To specify a padding value for a specific edge of the control, set its relevant property:

  • leftPadding
  • rightPadding
  • topPadding
  • bottomPadding

Definition at line 82 of file padding.h.

◆ rightPadding

qreal Padding::rightPadding
readwrite

This property holds the padding on the right side.

Unless explicitly set, it falls back to horizontalPadding and then to padding. This always refers to the actual right, it won't be flipped on RTL layouts.

Definition at line 119 of file padding.h.

◆ topPadding

qreal Padding::topPadding
readwrite

the padding on the top side.

Unless explicitly set, it falls back to verticalPadding and then to padding.

Definition at line 111 of file padding.h.

◆ verticalPadding

qreal Padding::verticalPadding
readwrite

This property holds the vertical padding.

Unless explicitly set, the value is equal to padding.

Definition at line 96 of file padding.h.

Constructor & Destructor Documentation

◆ Padding()

Padding::Padding ( QQuickItem * parent = nullptr)

Definition at line 114 of file padding.cpp.

◆ ~Padding()

Padding::~Padding ( )
override

Definition at line 120 of file padding.cpp.

Member Function Documentation

◆ availableHeight()

qreal Padding::availableHeight ( ) const

Definition at line 420 of file padding.cpp.

◆ availableWidth()

qreal Padding::availableWidth ( ) const

Definition at line 415 of file padding.cpp.

◆ bottomPadding()

qreal Padding::bottomPadding ( ) const

Definition at line 406 of file padding.cpp.

◆ componentComplete()

void Padding::componentComplete ( )
overrideprotectedvirtual

Reimplemented from QQuickItem.

Definition at line 465 of file padding.cpp.

◆ geometryChange()

void Padding::geometryChange ( const QRectF & newGeometry,
const QRectF & oldGeometry )
overrideprotectedvirtual

Reimplemented from QQuickItem.

Definition at line 443 of file padding.cpp.

◆ horizontalPadding()

qreal Padding::horizontalPadding ( ) const

Definition at line 229 of file padding.cpp.

◆ implicitContentHeight()

qreal Padding::implicitContentHeight ( ) const

Definition at line 434 of file padding.cpp.

◆ implicitContentWidth()

qreal Padding::implicitContentWidth ( ) const

Definition at line 425 of file padding.cpp.

◆ leftPadding()

qreal Padding::leftPadding ( ) const

Definition at line 295 of file padding.cpp.

◆ padding()

qreal Padding::padding ( ) const

Definition at line 196 of file padding.cpp.

◆ resetBottomPadding()

void Padding::resetBottomPadding ( )

Definition at line 392 of file padding.cpp.

◆ resetHorizontalPadding()

void Padding::resetHorizontalPadding ( )

Definition at line 215 of file padding.cpp.

◆ resetLeftPadding()

void Padding::resetLeftPadding ( )

Definition at line 281 of file padding.cpp.

◆ resetPadding()

void Padding::resetPadding ( )

Definition at line 180 of file padding.cpp.

◆ resetRightPadding()

void Padding::resetRightPadding ( )

Definition at line 355 of file padding.cpp.

◆ resetTopPadding()

void Padding::resetTopPadding ( )

Definition at line 318 of file padding.cpp.

◆ resetVerticalPadding()

void Padding::resetVerticalPadding ( )

Definition at line 248 of file padding.cpp.

◆ rightPadding()

qreal Padding::rightPadding ( ) const

Definition at line 369 of file padding.cpp.

◆ setBottomPadding()

void Padding::setBottomPadding ( qreal padding)

Definition at line 378 of file padding.cpp.

◆ setContentItem()

void Padding::setContentItem ( QQuickItem * item)

Definition at line 125 of file padding.cpp.

◆ setHorizontalPadding()

void Padding::setHorizontalPadding ( qreal padding)

Definition at line 201 of file padding.cpp.

◆ setLeftPadding()

void Padding::setLeftPadding ( qreal padding)

Definition at line 267 of file padding.cpp.

◆ setPadding()

void Padding::setPadding ( qreal padding)

Definition at line 164 of file padding.cpp.

◆ setRightPadding()

void Padding::setRightPadding ( qreal padding)

Definition at line 341 of file padding.cpp.

◆ setTopPadding()

void Padding::setTopPadding ( qreal padding)

Definition at line 304 of file padding.cpp.

◆ setVerticalPadding()

void Padding::setVerticalPadding ( qreal padding)

Definition at line 234 of file padding.cpp.

◆ topPadding()

qreal Padding::topPadding ( ) const

Definition at line 332 of file padding.cpp.

◆ updatePolish()

void Padding::updatePolish ( )
overrideprotectedvirtual

Reimplemented from QQuickItem.

Definition at line 454 of file padding.cpp.

◆ verticalPadding()

qreal Padding::verticalPadding ( ) const

Definition at line 262 of file padding.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:51:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.