QskControl

Base class of all controls. More…

#include <QskControl.h>

Inherits from QskQuickItem, QskSkinnable, QQuickItem

Inherited by QskAbstractButton, QskBoundedControl, QskBox, QskFocusIndicator, QskGraphicLabel, QskInputGrabber, QskInputPanel, QskPageIndicator, QskPopup, QskScrollBox, QskSeparator, QskStatusIndicator, QskSubWindowArea, QskTabView, QskTextInput, QskTextLabel

Public Types

  Name
enum LayoutHint { RetainSizeWhenHidden = 1 « 0, LayoutWhenHidden = 1 « 1}

Public Slots

  Name
void setLocale(const QLocale & locale)

Public Signals

  Name
void backgroundChanged()
void marginsChanged(const QMarginsF & )
void focusIndicatorRectChanged()
void localeChanged(const QLocale & )
void focusPolicyChanged()
void wheelEnabledChanged()

Public Functions

  Name
  QskControl(QQuickItem * parent =nullptr)
  ~QskControl() override
void setMargins(qreal margin)
void setMargins(qreal left, qreal top, qreal right, qreal bottom)
void setMargins(const QMarginsF & margins)
void resetMargins()
QMarginsF margins() const
void setBackgroundColor(const QColor & color)
void setBackground(const QskGradient & gradient)
void resetBackground()
QskGradient background() const
QRectF contentsRect() const
QRectF layoutRect() const
virtual QRectF layoutRectForSize(const QSizeF & size) const
virtual QRectF gestureRect() const
virtual QRectF focusIndicatorRect() const
virtual QRectF focusIndicatorClipRect() const
QRectF subControlRect(QskAspect::Subcontrol subControl) const
QRectF subControlRect(const QSizeF & size, QskAspect::Subcontrol subControl) const
QRectF subControlContentsRect(QskAspect::Subcontrol subControl) const
QRectF subControlContentsRect(const QSizeF & size, QskAspect::Subcontrol subControl) const
void setAutoFillBackground(bool on)
bool autoFillBackground() const
void setAutoLayoutChildren(bool on)
bool autoLayoutChildren() const
void setWheelEnabled(bool on)
bool isWheelEnabled() const
void setFocusPolicy(Qt::FocusPolicy policy)
Qt::FocusPolicy focusPolicy() const
void setSizePolicy(QskSizePolicy::Policy horizontalPolicy, QskSizePolicy::Policy verticalPolicy)
void setSizePolicy(QskSizePolicy policy)
void setSizePolicy(Qt::Orientation orientation, QskSizePolicy::Policy policy)
QskSizePolicy sizePolicy() const
QskSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const
void setLayoutAlignmentHint(Qt::Alignment alignment)
Qt::Alignment layoutAlignmentHint() const
void setLayoutHint(LayoutHint flag, bool on =true)
bool testLayoutHint(LayoutHint hint) const
void setLayoutHints(LayoutHints hints)
LayoutHints layoutHints() const
bool isVisibleToLayout() const
void setMinimumSize(const QSizeF & size)
void setMinimumSize(qreal width, qreal height)
void setMinimumWidth(qreal width)
void setMinimumHeight(qreal height)
void setMaximumSize(const QSizeF & size)
void setMaximumSize(qreal width, qreal height)
void setMaximumWidth(qreal width)
void setMaximumHeight(qreal height)
void setPreferredSize(const QSizeF & size)
void setPreferredSize(qreal width, qreal height)
void setPreferredWidth(qreal width)
void setPreferredHeight(qreal height)
void setFixedSize(const QSizeF & size)
void setFixedSize(qreal width, qreal height)
void setFixedWidth(qreal width)
void setFixedHeight(qreal height)
void setExplicitSizeHint(Qt::SizeHint whichHint, const QSizeF & size)
void setExplicitSizeHint(Qt::SizeHint whichHint, qreal width, qreal height)
void resetExplicitSizeHint(Qt::SizeHint whichHint)
QSizeF minimumSize() const
QSizeF maximumSize() const
QSizeF preferredSize() const
QSizeF explicitSizeHint(Qt::SizeHint whichHint) const
QSizeF implicitSizeHint(Qt::SizeHint whichHint, const QSizeF & constraint) const
QSizeF sizeHint() const
qreal heightForWidth(qreal width) const
qreal widthForHeight(qreal height) const
QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF & constraint =QSizeF()) const
QSizeF sizeConstraint(Qt::SizeHint which, const QSizeF & constraint =QSizeF()) const
QSizeF sizeConstraint() const
QLocale locale() const
void resetLocale()
QVector< QskAspect::Subcontrol > subControls() const
QRectF subControlRect(const QRectF & , QskAspect::Subcontrol )
Calculate position and size of a subControl.
QRectF subControlContentsRect(const QRectF & , QskAspect::Subcontrol )
Calculate the inner rectangle for subControl.

Protected Functions

  Name
bool event(QEvent * event) override
virtual void gestureEvent(QskGestureEvent * )
void hoverEnterEvent(QHoverEvent * event) override
void hoverLeaveEvent(QHoverEvent * event) override
bool childMouseEventFilter(QQuickItem * item, QEvent * event) override
virtual bool gestureFilter(QQuickItem * , QEvent * )
void itemChange(ItemChange , const ItemChangeData & ) override
void geometryChange(const QRectF & newGeometry, const QRectF & oldGeometry) override
void initSizePolicy(QskSizePolicy::Policy horizontalPolicy, QskSizePolicy::Policy verticalPolicy)
virtual void updateResources()
virtual void updateLayout()
virtual QSizeF contentsSizeHint(Qt::SizeHint which, const QSizeF & constraint) const
virtual QSizeF layoutSizeHint(Qt::SizeHint which, const QSizeF & constraint) const

Public Properties

  Name
QLocale locale
bool autoFillBackground
bool autoLayoutChildren
Qt::FocusPolicy focusPolicy
bool wheelEnabled
bool visibleToLayout
QskMargins margins
QskGradient background
QskSizePolicy sizePolicy
QSizeF minimumSize
QSizeF maximumSize
QSizeF preferredSize
QSizeF sizeConstraint

Public Attributes

  Name
const QskAspect::State Disabled
const QskAspect::State Hovered
const QskAspect::State Focused

Additional inherited members

Public Types inherited from QskQuickItem

  Name
enum UpdateFlag { DeferredUpdate, DeferredPolish, DeferredLayout, CleanupOnVisibility, PreferRasterForTextures, DebugForceBackground}

Public Slots inherited from QskQuickItem

  Name
void setGeometry(const QRectF & rect)
void show()
void hide()
void setHidden(bool on)
void setDisabled(bool on)
void resetImplicitSize()

Public Signals inherited from QskQuickItem

  Name
void itemFlagsChanged()
void updateFlagsChanged(UpdateFlags )

Public Functions inherited from QskQuickItem

  Name
  ~QskQuickItem() override
const char * className() const
bool isVisibleTo(const QQuickItem * ancestor) const
bool isVisibleToParent() const
bool hasChildItems() const
QRectF rect() const
QSizeF implicitSize() const
void setGeometry(qreal x, qreal y, qreal width, qreal height)
void setGeometry(const QPointF & pos, const QSizeF & size)
QRectF geometry() const
void setPosition(qreal x, qreal y)
void setSize(qreal width, qreal height)
void setPolishOnResize(bool on)
bool polishOnResize() const
void setTransparentForPositioner(bool on)
bool isTransparentForPositioner() const
void setTabFence(bool on)
bool isTabFence() const
void setLayoutMirroring(bool on, bool childrenInherit =false)
void resetLayoutMirroring()
bool layoutMirroring() const
void resetUpdateFlags()
UpdateFlags updateFlags() const
Q_INVOKABLE void setUpdateFlag(UpdateFlag flag, bool on =true)
Q_INVOKABLE void resetUpdateFlag(UpdateFlag flag)
Q_INVOKABLE bool testUpdateFlag(UpdateFlag flag) const
void classBegin() override
void componentComplete() override
void releaseResources() override
bool isPolishScheduled() const
bool isUpdateNodeScheduled() const
bool isInitiallyPainted() const
bool maybeUnresized() const

Protected Functions inherited from QskQuickItem

  Name
  QskQuickItem(QskQuickItemPrivate & dd, QQuickItem * parent =nullptr)
virtual void changeEvent(QEvent * )
virtual void geometryChangeEvent(QskGeometryChangeEvent * )
virtual void windowChangeEvent(QskWindowChangeEvent * )
void mouseUngrabEvent() override
void touchUngrabEvent() override
virtual void aboutToShow()

Public Properties inherited from QskQuickItem

  Name
QRectF geometry
QRectF rect
bool transparentForPositioners
bool tabFence
bool polishOnResize
bool visibleToParent
bool hasChildItems
bool initiallyPainted
UpdateFlags updateFlags

Public Functions inherited from QskSkinnable

  Name
  QskSkinnable()
virtual ~QskSkinnable()
void setSkinlet(const QskSkinlet * skinlet)
Set an individual skinlet to render/display the content.
const QskSkinlet * skinlet() const
QFont effectiveFont(QskAspect aspect) const
QskColorFilter effectiveGraphicFilter(QskAspect aspect) const
void setSubcontrolProxy(QskAspect::Subcontrol subControl, QskAspect::Subcontrol proxy)
void resetSubcontrolProxy(QskAspect::Subcontrol subcontrol)
QskAspect::Subcontrol subcontrolProxy(QskAspect::Subcontrol subControl) const
bool setAnimationHint(QskAspect aspect, QskAnimationHint hint)
QskAnimationHint animationHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
bool setSkinHint(QskAspect aspect, const QVariant & hint)
Insert a hint into the local hint table.
bool resetSkinHint(QskAspect aspect)
Remove a hint from the local hint table.
QskAnimationHint effectiveAnimation(QskAspect::Type type, QskAspect::Subcontrol subControl, QskAspect::States states, QskSkinHintStatus * status =nullptr) const
QVariant effectiveSkinHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Find the value for a specific aspect.
virtual QskAspect::Placement effectivePlacement() const
QskSkinHintStatus hintStatus(QskAspect aspect) const
QSizeF outerBoxSize(QskAspect aspect, const QSizeF & innerBoxSize) const
Calculate the size, when being expanded by paddings, indentations.
QSizeF innerBoxSize(QskAspect aspect, const QSizeF & outerBoxSize) const
Calculate the size, with paddings, indentations being subtracted.
QRectF innerBox(QskAspect aspect, const QRectF & outerBox) const
Calculate the rectangle, whith paddings, indentations being subtracted.
QRectF outerBox(QskAspect aspect, const QRectF & innerBox) const
Calculate the rectangle, when being expanded by paddings, indentations.
QMarginsF innerPadding(QskAspect aspect, const QSizeF & outerBoxSize) const
Calculate the padding from attributes for the given aspect.
const QskSkinlet * effectiveSkinlet() const
QskSkin * effectiveSkin() const
void startTransition(QskAspect aspect, QskAnimationHint animationHint, QVariant from, QVariant to)
QskAspect::Subcontrol effectiveSubcontrol(QskAspect::Subcontrol subControl) const
QskControl * controlCast()
const QskControl * controlCast() const
virtual const QMetaObject * metaObject() const =0
void debug(QskAspect aspect) const
void debug(QskAspect::State state) const
void debug(QDebug debug, QskAspect aspect) const
void debug(QDebug debug, QskAspect::State state) const
void setSkinStates(QskAspect::States newStates)
void setSkinStateFlag(QskAspect::State stateFlag, bool on =true)
void addSkinStates(QskAspect::States states)
void clearSkinStates(QskAspect::States states)
void replaceSkinStates(QskAspect::States newStates)
bool hasSkinState(QskAspect::State state) const
QskAspect::States skinStates() const
const char * skinStatesAsPrintable() const
const char * skinStatesAsPrintable(QskAspect::States states) const
bool setColor(QskAspect aspect, Qt::GlobalColor color)
Sets a color hint.
bool setColor(QskAspect aspect, QRgb rgb)
Sets a color hint.
bool setColor(QskAspect aspect, const QColor & color)
Sets a color hint.
bool resetColor(QskAspect aspect)
Removes a color hint from the local table.
QColor color(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a color hint.
bool setMetric(QskAspect aspect, qreal metric)
Sets a metric hint.
bool resetMetric(QskAspect aspect)
Removes a metric hint from the local table.
qreal metric(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a metric hint.
bool setFlagHint(QskAspect aspect, int flag)
Sets a flag hint.
bool resetFlagHint(QskAspect aspect)
Removes a flag hint from the local table.
int flagHint(QskAspect aspect) const
Retrieves a flag hint.
template <typename T >
T
flagHint(QskAspect aspect, T defaultValue =T()) const
Retrieves a flag hint.
bool setStrutSizeHint(QskAspect aspect, const QSizeF & size)
Sets a metric hint.
bool setStrutSizeHint(QskAspect aspect, qreal width, qreal height)
Sets a strut size hint.
bool resetStrutSizeHint(QskAspect aspect)
Removes a strut size hint from the local table.
QSizeF strutSizeHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a strut size hint.
bool setMarginHint(QskAspect aspect, qreal margins)
Sets a margin hint.
bool setMarginHint(QskAspect aspect, const QMarginsF & margins)
Sets a margin hint.
bool resetMarginHint(QskAspect aspect)
Removes a margin hint from the local table.
QMarginsF marginHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a margin hint.
bool setPaddingHint(QskAspect aspect, qreal padding)
Sets a padding hint.
bool setPaddingHint(QskAspect aspect, const QMarginsF & padding)
Sets a padding hint.
bool resetPaddingHint(QskAspect aspect)
Removes a padding hint from the local table.
QMarginsF paddingHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a padding hint.
bool setGradientHint(QskAspect aspect, const QskGradient & gradient)
Sets a gradient as color hint.
QskGradient gradientHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a color hint as gradient.
bool setBoxShapeHint(QskAspect aspect, const QskBoxShapeMetrics & shape)
Sets a shape hint.
bool resetBoxShapeHint(QskAspect aspect)
Removes a shape hint from the local table.
QskBoxShapeMetrics boxShapeHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a shape hint.
bool setBoxBorderMetricsHint(QskAspect aspect, const QskBoxBorderMetrics & border)
Sets a border metrics hint.
bool resetBoxBorderMetricsHint(QskAspect aspect)
Removes a border metrics hint from the local table.
QskBoxBorderMetrics boxBorderMetricsHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a border hint.
bool setBoxBorderColorsHint(QskAspect aspect, const QskBoxBorderColors & colors)
Sets a border colors hint.
bool resetBoxBorderColorsHint(QskAspect aspect)
Removes a border colors hint from the local table.
QskBoxBorderColors boxBorderColorsHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves border colors hint.
bool setArcMetricsHint(QskAspect aspect, const QskArcMetrics & arc)
bool resetArcMetricsHint(QskAspect aspect)
QskArcMetrics arcMetricsHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
bool setSpacingHint(QskAspect aspect, qreal spacing)
Sets a spacing hint.
bool resetSpacingHint(QskAspect aspect)
Removes a spacing hint from the local table.
qreal spacingHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a spacing hint.
bool setAlignmentHint(QskAspect aspect, Qt::Alignment alignment)
Sets an alignment hint.
bool resetAlignmentHint(QskAspect aspect)
Removes an alignment hint from the local table.
Qt::Alignment alignmentHint(QskAspect aspect, Qt::Alignment defaultAlignment =Qt::Alignment()) const
Retrieves an alignment hint.
bool setFontRoleHint(QskAspect aspect, int role)
Sets a font role hint.
bool resetFontRoleHint(QskAspect aspect)
Removes a font role hint from the local table.
int fontRoleHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
Retrieves a font role hint.
bool setGraphicRoleHint(QskAspect aspect, int role)
Sets a graphic role hint.
bool resetGraphicRoleHint(QskAspect aspect)
Removes a graphic role hint from the local table.
int graphicRoleHint(QskAspect aspect, QskSkinHintStatus * status =nullptr) const
A Retrieves a graphic role hint.

Protected Functions inherited from QskSkinnable

  Name
virtual void updateNode(QSGNode * parentNode)
virtual bool isTransitionAccepted(QskAspect aspect) const
Additional check if an transition should be started.
virtual QskAspect::Subcontrol substitutedSubcontrol(QskAspect::Subcontrol subControl) const
QskSkinHintTable & hintTable()
Accessor for local skin hint table.
const QskSkinHintTable & hintTable() const
Accessor for local skin hint table.

Detailed Description

class QskControl;

Base class of all controls.

Par: States:

QskControl::Disabled, QskControl::Hovered, QskControl::Focused

QskControl combines the themeability implemented in QskSkinnable with what is needed to support a layout system, that is on par with what is known from Qt/Widgets.

Public Types Documentation

enum LayoutHint

Enumerator Value Description
RetainSizeWhenHidden 1 « 0  
When being enabled the layout code should retain the necessary space
for the control even when it is hidden.
\saqt QSizePolicy::retainSizeWhenHidden()    
  LayoutWhenHidden 1 « 1
When being enabled the layout code should set the geometry
to the control - even if it is not visible.
``` |




**See**: setLayoutHint(), testLayoutHint(), setLayoutHints(), layoutHints() [setAutoLayoutChildren()](/docs/classes/classQskControl/#function-setautolayoutchildren), [QskLinearBox](/docs/classes/classQskLinearBox/), QskGridBox, QskStackBox 

Hints, that can be used by the layout code


## Public Slots Documentation

### slot setLocale

```cpp
void setLocale(
    const QLocale & locale
)

Public Signals Documentation

signal backgroundChanged

void backgroundChanged()

See: background

Signal indicating, that the value of the background property has changed

signal marginsChanged

void marginsChanged(
    const QMarginsF & 
)

See: margins

Signal indicating, that the value of the margins property has changed

signal focusIndicatorRectChanged

void focusIndicatorRectChanged()

See: focusIndicatorRect()

Signal indicating that the value of the focusIndicatorRect() has changed.

signal localeChanged

void localeChanged(
    const QLocale & 
)

signal focusPolicyChanged

void focusPolicyChanged()

signal wheelEnabledChanged

void wheelEnabledChanged()

Public Functions Documentation

function QskControl

QskControl(
    QQuickItem * parent =nullptr
)

Initializes focusPolicy to Qt::NoFocus and disables processing of wheel events. The default sizePolicy is QskSizePolicy::Preferred in vertical and horizontal direction.

function ~QskControl

~QskControl() override

Destructor

function setMargins

void setMargins(
    qreal margin
)

Parameters:

See: contentsRect(), margins(), QskSkinnable::setMarginHint()

Par: Aspect

QskControl::Control QskAspect::Metric QskAspect::Margin

Sets the margins around the contents of the control

The value is stored in the local hint table for the aspect: QskControl::Control QskAspect::Metric QskAspect::Margin

function setMargins

void setMargins(
    qreal left,
    qreal top,
    qreal right,
    qreal bottom
)

function setMargins

void setMargins(
    const QMarginsF & margins
)

Parameters:

See: contentsRect(), margins() \saqt QEvent::ContentsRectChange

Par: Aspect

QskControl::Control QskAspect::Metric QskAspect::Margin

Sets the margins around the contents of the control

function resetMargins

void resetMargins()

See: contentsRect(), setMargins(), margins() \saqt QEvent::ContentsRectChange

Par: Aspect

QskControl::Control QskAspect::Metric QskAspect::Margin

Reset the margins to the default value provided from the skin

function margins

QMarginsF margins() const

See: contentsRect(), setMargins() \saqt QEvent::ContentsRectChange

Return: margins around the contents of the control

Par: Aspect

QskControl::Control QskAspect::Metric QskAspect::Margin

function setBackgroundColor

void setBackgroundColor(
    const QColor & color
)

See:

A conveninece method that enables the autoFillBackground property and sets a solid color as background. Usually used for debugging layout problems.

function setBackground

void setBackground(
    const QskGradient & gradient
)

See: resetBackground(), background(), autoFillBackground()

Par: Aspect

QskControl::Control QskAspect::Color

Set the gradient that is used to fill the background, when autoFillBackground is enabled.

function resetBackground

void resetBackground()

See: setBackground(), background(), autoFillBackground()

Par: Aspect

QskControl::Control QskAspect::Color

Reset the background gradient to the default colors from the skin

function background

QskGradient background() const

See: setBackground(), resetBackground(), autoFillBackground()

Return: Gradient that is used to fill the background, when autoFillBackground is enabled.

Par: Aspect

QskControl::Control QskAspect::Color

function contentsRect

QRectF contentsRect() const

See: margins(), setMargins(), layoutRect()

Returns the area inside the controls’s margins.

contentsRect() is a rectangle being used for laying out scene graph nodes, while layoutRect() is used for child items.

function layoutRect

QRectF layoutRect() const

See: layoutRectForSize(), contentsRect()

Returns the area for laying out child items

layoutRect() is a rectangle being used for laying out child items, while contentsRect() is used for scene graph nodes.

F.e QskBox::layoutRect() returns an area that fits inside the ( maybe rounded ) borders, while the borders itself are rendered into the contentsRect().

The implementation relies on layoutRectForSize()

function layoutRectForSize

virtual QRectF layoutRectForSize(
    const QSizeF & size
) const

Parameters:

Return: Area, where to lay out the child items

Returns the geometry where to lay out child items for a given size.

layoutRectForSize() is intended to be overloaded, when layoutRect() is supposed differ from contentsRect()

function gestureRect

virtual QRectF gestureRect() const

See: gestureFilter(), gestureEvent()

Returns the area where to accept gestures. The default implementation returns QskQuickItem::rect().

function focusIndicatorRect

virtual QRectF focusIndicatorRect() const

See: QskFocusIndicator, focusIndicatorClipRect(), focusIndicatorRectChanged()

Returns the rectangle where to draw the focus indicator

For controls, that implement some sort of internal focus chain ( list boxes, sliders with more handles … ) the rectangle might change according to the state of the control.

The default implementation return contentsRect()

function focusIndicatorClipRect

virtual QRectF focusIndicatorClipRect() const

This is a specific rectangle, that can be returned to clip the focus indicator being displayed for a child item.

The default implementation return QQuickItem::contentsRect()

function subControlRect

QRectF subControlRect(
    QskAspect::Subcontrol subControl
) const

Parameters:

See: QskSkinnable::subControlRect

Return: Bounding rectangle for the subControl

Calculates the rectangle for a subcontrol from contentsRect().

function subControlRect

QRectF subControlRect(
    const QSizeF & size,
    QskAspect::Subcontrol subControl
) const

Parameters:

See: QskSkinnable::subControlRect

Return: Bounding rectangle for the subControl

Calculates the rectangle for a subcontrol inside a rectangle at the position 0, 0 for the given size

function subControlContentsRect

QRectF subControlContentsRect(
    QskAspect::Subcontrol subControl
) const

Parameters:

See: QskSkinnable::subControlContentsRect

Return: Inner rectangle of the subControl

Calculate the inner rectangle for subControl calculated from contentsRect.

function subControlContentsRect

QRectF subControlContentsRect(
    const QSizeF & size,
    QskAspect::Subcontrol subControl
) const

Parameters:

See: QskSkinnable::subControlContentsRect

Return: Inner rectangle of the subControl

Calculate the inner rectangle for subControl for a rectangle at the position 0, 0 for the given size

function setAutoFillBackground

void setAutoFillBackground(
    bool on
)

See: autoFillBackground()

Set or clear the autoFillBackground property

function autoFillBackground

bool autoFillBackground() const

See: setAutoFillBackground()

Return: Value of the autoFillBackground property

function setAutoLayoutChildren

void setAutoLayoutChildren(
    bool on
)

See: autoFillBackground()

Set or clear the autoLayoutChildren property

function autoLayoutChildren

bool autoLayoutChildren() const

See: setAutoLayoutChildren()

Return: Value of the autoLayoutChildren property

function setWheelEnabled

void setWheelEnabled(
    bool on
)

See: wheelEnabledisWheelEnabled

Set or clear the wheelEnabled property

function isWheelEnabled

bool isWheelEnabled() const

See: wheelEnabled

Return: Value of the wheelEnabled property

function setFocusPolicy

void setFocusPolicy(
    Qt::FocusPolicy policy
)

See: focusPolicy()

Set the value for the focusPolicy property

function focusPolicy

Qt::FocusPolicy focusPolicy() const

See: focusPolicy(), setFocusPolicy()

Return: Value of the focusPolicy property

function setSizePolicy

void setSizePolicy(
    QskSizePolicy::Policy horizontalPolicy,
    QskSizePolicy::Policy verticalPolicy
)

function setSizePolicy

void setSizePolicy(
    QskSizePolicy policy
)

function setSizePolicy

void setSizePolicy(
    Qt::Orientation orientation,
    QskSizePolicy::Policy policy
)

function sizePolicy

QskSizePolicy sizePolicy() const

Return: Value of the sizePolicy property

function sizePolicy

QskSizePolicy::Policy sizePolicy(
    Qt::Orientation orientation
) const

function setLayoutAlignmentHint

void setLayoutAlignmentHint(
    Qt::Alignment alignment
)

function layoutAlignmentHint

Qt::Alignment layoutAlignmentHint() const

function setLayoutHint

void setLayoutHint(
    LayoutHint flag,
    bool on =true
)

function testLayoutHint

bool testLayoutHint(
    LayoutHint hint
) const

function setLayoutHints

void setLayoutHints(
    LayoutHints hints
)

function layoutHints

LayoutHints layoutHints() const

function isVisibleToLayout

bool isVisibleToLayout() const

See: isVisibleToParent(), RetainSizeWhenHidden

Return true, when the control is relevant for layout calculations

A control has an impact on the layout calutaions, when:

function setMinimumSize

void setMinimumSize(
    const QSizeF & size
)

See: setExplicitSizeHint(), setMinimumWidth(), setMinimumHeight(), minimumSize()

Sets the minimum size.

The minimum size is a synonym for the explicit size hint for Qt::MinimumSize.

function setMinimumSize

void setMinimumSize(
    qreal width,
    qreal height
)

See: setExplicitSizeHint(), setMinimumWidth(), setMinimumHeight(), minimumSize()

Sets the minimum size.

The minimum size is a synonym for the explicit size hint for Qt::MinimumSize.

function setMinimumWidth

void setMinimumWidth(
    qreal width
)

See: setExplicitSizeHint(), setMinimumSize(), setMinimumHeight(), minimumSize()

Sets the minimum width.

The minimum width is a synonym for the width of the explicit size hint for Qt::MinimumSize.

function setMinimumHeight

void setMinimumHeight(
    qreal height
)

See: setExplicitSizeHint(), setMinimumSize(), setMinimumWidth(), minimumSize()

Sets the minimum height.

The minimum height is a synonym for the height of the explicit size hint for Qt::MinimumSize.

function setMaximumSize

void setMaximumSize(
    const QSizeF & size
)

See: setExplicitSizeHint(), setMaximumWidth(), setMaximumHeight(), maximumSize()

Sets the maximum size.

The maximum size is a synonym for the explicit size hint for Qt::MaximumSize.

function setMaximumSize

void setMaximumSize(
    qreal width,
    qreal height
)

See: setExplicitSizeHint(), setMaximumWidth(), setMaximumHeight(), maximumSize()

Sets the maximum size.

The maximum size is a synonym for the explicit size hint for Qt::MaximumSize.

function setMaximumWidth

void setMaximumWidth(
    qreal width
)

See: setExplicitSizeHint(), setMaximumSize(), setMaximumHeight(), maximumSize()

Sets the maximum width.

The minimum width is a synonym for the width of the explicit size hint for Qt::MaximumSize.

function setMaximumHeight

void setMaximumHeight(
    qreal height
)

See: setExplicitSizeHint(), setMaximumSize(), setMaximumWidth(), maximumSize()

Sets the maximum height.

The maximum height is a synonym for the height of the explicit size hint for Qt::MaximumSize.

function setPreferredSize

void setPreferredSize(
    const QSizeF & size
)

See: setExplicitSizeHint(), setPreferredWidth(), setPreferredHeight(), preferredSize()

Sets the preferred size.

The preferred size is a synonym for the explicit size hint for Qt::PreferredSize.

function setPreferredSize

void setPreferredSize(
    qreal width,
    qreal height
)

See: setExplicitSizeHint(), setPreferredWidth(), setPreferredHeight(), preferredSize()

Sets the preferred size.

The preferred size is a synonym for the explicit size hint for Qt::PreferredSize.

function setPreferredWidth

void setPreferredWidth(
    qreal width
)

See: setExplicitSizeHint(), setPreferredSize(), setPreferredHeight(), preferredSize()

Sets the preferred width.

The preferred width is a synonym for the width of the explicit size hint for Qt::PreferredSize.

function setPreferredHeight

void setPreferredHeight(
    qreal height
)

See: setExplicitSizeHint(), setPreferredSize(), setPreferredWidth(), preferredSize()

Sets the preferred height.

The preferred height is a synonym for the height of the explicit size hint for Qt::PreferredSize.

function setFixedSize

void setFixedSize(
    const QSizeF & size
)

Warning: The name of this method is misleading as it only sets a size hint, but does not change the size as it implies. Without a layout code, that respects this value it does not have any effect. However the name was chosen as with Qt/Widgets there is a corresponding call with the same semantics developers might be familiar with.

Sets the explicit size hint for Qt::PreferredSize and changes the size policy to QskSizePolicy::Fixed for both orientations.

function setFixedSize

void setFixedSize(
    qreal width,
    qreal height
)

Sets the explicit size hint for Qt::PreferredSize and changes the size policy to QskSizePolicy::Fixed for both orientations.

function setFixedWidth

void setFixedWidth(
    qreal width
)

Sets the width of the explicit size hint for Qt::PreferredSize and changes the horizontal size policy to QskSizePolicy::Fixed.

function setFixedHeight

void setFixedHeight(
    qreal height
)

Sets the height of the explicit size hint for Qt::PreferredSize and changes the vertical size policy to QskSizePolicy::Fixed.

function setExplicitSizeHint

void setExplicitSizeHint(
    Qt::SizeHint whichHint,
    const QSizeF & size
)

function setExplicitSizeHint

void setExplicitSizeHint(
    Qt::SizeHint whichHint,
    qreal width,
    qreal height
)

function resetExplicitSizeHint

void resetExplicitSizeHint(
    Qt::SizeHint whichHint
)

function minimumSize

inline QSizeF minimumSize() const

Return: The explicit size hint for Qt::MinimumSize

function maximumSize

inline QSizeF maximumSize() const

Return: The explicit size hint for Qt::MaximumSize

function preferredSize

inline QSizeF preferredSize() const

Return: The explicit size hint for Qt::PreferredSize

function explicitSizeHint

QSizeF explicitSizeHint(
    Qt::SizeHint whichHint
) const

function implicitSizeHint

QSizeF implicitSizeHint(
    Qt::SizeHint whichHint,
    const QSizeF & constraint
) const

function sizeHint

inline QSizeF sizeHint() const

Return: The explicit size hint for Qt::PreferredSize

Note: sizeHint() does exactly the same as preferredSize() and only exists because of being a name, that is well known from Qt/Widgets

function heightForWidth

qreal heightForWidth(
    qreal width
) const

See: effectiveSizeHint(), widthForHeight()

Return: Preferred height for given a width.

function widthForHeight

qreal widthForHeight(
    qreal height
) const

See: effectiveSizeHint(), heightForWidth()

Return: Preferred width for given a height.

function effectiveSizeHint

QSizeF effectiveSizeHint(
    Qt::SizeHint which,
    const QSizeF & constraint =QSizeF()
) const

function sizeConstraint

QSizeF sizeConstraint(
    Qt::SizeHint which,
    const QSizeF & constraint =QSizeF()
) const

function sizeConstraint

inline QSizeF sizeConstraint() const

function locale

QLocale locale() const

function resetLocale

void resetLocale()

function subControls

QVector< QskAspect::Subcontrol > subControls() const

See: QskAspect::subControls(), QskControl::effectiveSubcontrol()

Calculates and returns a list of all effective subcontrols, that have been defined for the corresponding metaObject(). This list can be used to decide if a skin hint for specific subControl might have an impact on a control.

function subControlRect

QRectF subControlRect(
    const QRectF & ,
    QskAspect::Subcontrol 
)

Calculate position and size of a subControl.

Parameters:

See: effectiveSkinlet(), QskSkinlet::subControlRect(), QskControl::contentsRect()

Return: Geometry for the subControl

A convenience method that forwards the calculation to the skinlet

function subControlContentsRect

QRectF subControlContentsRect(
    const QRectF & ,
    QskAspect::Subcontrol 
)

Calculate the inner rectangle for subControl.

Parameters:

See: QskSkinlet::subControlRect(), innerBox()

Return: Geometry for contents inside the subControl

The inner rectangle a subcontrol is its geometry with paddings, indentations being subtracted. F.e. the inner rectangle of QskPushButton::Panel is the bounding rectangle for laying out the QskPushButton::Text and QskPushButton::Graphic subcontrols.

Protected Functions Documentation

function event

bool event(
    QEvent * event
) override

function gestureEvent

virtual void gestureEvent(
    QskGestureEvent * 
)

function hoverEnterEvent

void hoverEnterEvent(
    QHoverEvent * event
) override

Sets the Hovered state

function hoverLeaveEvent

void hoverLeaveEvent(
    QHoverEvent * event
) override

Clears the Hovered state

function childMouseEventFilter

bool childMouseEventFilter(
    QQuickItem * item,
    QEvent * event
) override

function gestureFilter

virtual bool gestureFilter(
    QQuickItem * ,
    QEvent * 
)

function itemChange

void itemChange(
    ItemChange ,
    const ItemChangeData & 
) override

Overload, that updates certain QSkinny specific attributes

function geometryChange

void geometryChange(
    const QRectF & newGeometry,
    const QRectF & oldGeometry
) override

Overload, that schedules a re-layouting of the child items when autoLayoutChildren() is enabled.

function initSizePolicy

void initSizePolicy(
    QskSizePolicy::Policy horizontalPolicy,
    QskSizePolicy::Policy verticalPolicy
)

A simpler version of setSizePolicy(), that does not send a QEvent::LayouRequest to the parentItem(). It is used in constructors of derived controls.

function updateResources

virtual void updateResources()

function updateLayout

virtual void updateLayout()

Reimplemented by: QskLinearBox::updateLayout

function contentsSizeHint

virtual QSizeF contentsSizeHint(
    Qt::SizeHint which,
    const QSizeF & constraint
) const

function layoutSizeHint

virtual QSizeF layoutSizeHint(
    Qt::SizeHint which,
    const QSizeF & constraint
) const

Reimplemented by: QskLinearBox::layoutSizeHint

Public Property Documentation

property locale

QLocale locale;

Par: Access functions:

locale(), setLocale(), resetLocale(), localeChanged()

The locale of the control

As long as no special locale has been set, this is the locale of the parentItem(). If none of the ancestors has a special locale it is the locale of the window ( in case it is a QskWindow ). Otherwise it is is the default locale.

property autoFillBackground

bool autoFillBackground;

See: background() \saqt QWidget::autoFillBackground

Par: Access functions:

autoFillBackground(), setAutoFillBackground()

This property holds whether the background is filled automatically with the background gradient.

property autoLayoutChildren

bool autoLayoutChildren;

See: layoutRect(), layoutHints(), layoutAlignmentHint(), QskQuickItem::transparentForPositioners \saqt QQuickItem::updatePolish()

Note: Auto layouting is similar to what happens when putting several items into the same cell of a QskGridBox.

Par:

autoLayoutChildren(), setAutoLayoutChildren()

autoLayoutChildren(), setAutoLayoutChildren()

QskControl offers basic layout functionalities that can be enabled be setting the autoLayoutChildren flag. The default setting is false.

Auto layouting calculates and assignes the geometries of childItems()

property focusPolicy

Qt::FocusPolicy focusPolicy;

Note: For some reason Qt/Quick only offers a crippled version of the focus policy as QQuickItem::activeFocusOnTab(). The implementation in QskControl is using this flag for the Qt::TabFocus bit, but also supports all other bits that are known from Qt/Widgets.

Par: Access functions:

focusPolicy(), setFocusPolicy(), focusPolicyChanged()

This property holds the way the control accepts keyboard focus

The default setting is Qt::NoFocus, accepting no keyboard inputs.

\saqt QQuickItem::activeFocusOnTab()

property wheelEnabled

bool wheelEnabled;

Note:

Par: Access functions:

isWheelEnabled(), setWheelEnabled(), wheelEnabledChanged() \saqt QQuickItem::wheelEvent()

This property indicates if a control is interested in receiving wheel events.

property visibleToLayout

bool visibleToLayout;

Par: Access functions:

isVisibleToLayout()

Allows calling isVisibleToLayout() as a property.

property margins

QskMargins margins;

Par: Access functions:

margins(), setMargins(), resetMargins(), marginsChanged()

property background

QskGradient background;

Par: Access functions:

background(), setBackground(), resetBackground(), backgroundChanged()

property sizePolicy

QskSizePolicy sizePolicy;

Par: Access functions:

sizePolicy(), setSizePolicy()

property minimumSize

QSizeF minimumSize;

See: effectiveSizeHint(), setExplicitSizeHint() setMinimumWidth(), setMinimumHeight()

Par: Access functions:

minimumSize(), setMinimumSize()

property maximumSize

QSizeF maximumSize;

See: effectiveSizeHint(), setExplicitSizeHint() setMaximumWidth(), setMaximumHeight()

Par: Access functions:

maximumSize(), setMaximumSize()

property preferredSize

QSizeF preferredSize;

See: effectiveSizeHint(), setExplicitSizeHint(), setPreferredWidth(), setPreferredHeight()

Par: Access functions:

preferredSize(), setPreferredSize()

property sizeConstraint

QSizeF sizeConstraint;

Par: Access functions:

sizeConstraint()

Public Attributes Documentation

variable Disabled

static const QskAspect::State Disabled;

See: QskQuickItem::setDisabled() \saqt QQuickItem::enabled

A state bit that is set, when QQuickItem::isEnabled() == false.

variable Hovered

static const QskAspect::State Hovered;
A state bit that is set, when the item is hovered
It allows to define a specific representation in the skin,
when being hovered.

\saqt QQuickItem::acceptHoverEvents(), QQuickItem::hoverEnterEvent(), QQuickItem::hoverLeaveEvent()

variable Focused

static const QskAspect::State Focused;

See: focusPolicy \saqt QQuickItem::acceptHoverEvents(), QQuickItem::focusInEvent(), QQuickItem::focusOutEvent()

A state bit that is set, when the item is the active focus item

Updated on 28 July 2023 at 14:02:29 CEST