qskinny/doc/classes/QskControl.dox

771 lines
14 KiB
Plaintext
Raw Normal View History

2020-12-08 10:02:57 +00:00
/*!
2020-12-12 13:05:09 +00:00
\class QskControl QskControl.h
2021-04-23 13:15:18 +00:00
\ingroup Framework Controls
2020-12-08 10:02:57 +00:00
2021-03-04 08:15:19 +00:00
\brief Base class of all controls
2020-12-08 10:02:57 +00:00
2021-05-03 12:13:33 +00:00
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.
\todo Explain: QskQuickItem::geometry(), QskQuickItem::rect(),
QQuickItem::boundingRect(), layoutRect(), contentsRect(),
subControlRect(), focusIndicatorRect(), QQuickItem::clipRect(),
QQuickItem::contains()
2021-04-23 15:31:28 +00:00
\states QskControl::Disabled, QskControl::Hovered, QskControl::Focused
*/
/*!
\var QskControl::Disabled
A state bit that is set, when QQuickItem::isEnabled() == false.
\extends QskAspect::State
\sa QskQuickItem::setDisabled()
\saqt QQuickItem::enabled
\var QskControl::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()
\var QskControl::Focused
A state bit that is set, when the item is the active focus item
\sa focusPolicy
\saqt QQuickItem::acceptHoverEvents(), QQuickItem::focusInEvent()
QQuickItem::focusOutEvent()
2021-03-04 08:15:19 +00:00
*/
/*!
\enum QskControl::LayoutHint
2021-04-23 15:31:28 +00:00
Hints, that can be used by the layout code
2021-03-04 08:15:19 +00:00
\sa setLayoutHint(), testLayoutHint(), setLayoutHints(), layoutHints()
2021-04-23 15:31:28 +00:00
setAutoLayoutChildren(), QskLinearBox, QskGridBox, QskStackBox
2021-03-04 08:15:19 +00:00
\var QskControl::RetainSizeWhenHidden
2021-04-23 15:31:28 +00:00
When being enabled the layout code should retain the necessary space
for the control even when it is hidden.
\saqt QSizePolicy::retainSizeWhenHidden()
2021-03-04 08:15:19 +00:00
2021-04-23 15:31:28 +00:00
\var QskControl::LayoutWhenHidden
2021-03-04 08:15:19 +00:00
2021-04-23 15:31:28 +00:00
When being enabled the layout code should set the geometry
to the control - even if it is not visible.
2021-03-04 08:15:19 +00:00
*/
/*!
\property QLocale QskControl::locale
\accessors locale(), setLocale(), resetLocale(), localeChanged()
*/
/*!
\property bool QskControl::autoFillBackground
2021-04-23 15:31:28 +00:00
This property holds whether the background is filled automatically
with the background gradient.
2021-03-04 08:15:19 +00:00
\accessors autoFillBackground(), setAutoFillBackground()
2021-04-23 15:31:28 +00:00
\sa background()
\saqt QWidget::autoFillBackground
2021-03-04 08:15:19 +00:00
*/
/*!
\property bool QskControl::autoLayoutChildren
\accessors autoLayoutChildren(), setAutoLayoutChildren()
*/
/*!
\property Qt::FocusPolicy QskControl::focusPolicy
\accessors focusPolicy(), setFocusPolicy(), focusPolicyChanged()
*/
/*!
\property bool QskControl::wheelEnabled
\accessors isWheelEnabled(), setWheelEnabled(), wheelEnabledChanged()
*/
/*!
\property bool QskControl::visibleToLayout
\accessors isVisibleToLayout()
*/
/*!
\property QskMargins QskControl::margins
\accessors margins(), setMargins(), resetMargins(), marginsChanged()
*/
/*!
\property QskGradient QskControl::background
\accessors background(), setBackground(), resetBackground(), backgroundChanged()
*/
/*!
\property QskSizePolicy QskControl::sizePolicy
\accessors sizePolicy(), setSizePolicy()
*/
/*!
\property bool QskControl::autoLayoutChildren
\accessors autoLayoutChildren(), setAutoLayoutChildren()
*/
/*!
\property QSizeF QskControl::minimumSize
\accessors minimumSize(), setMinimumSize()
\sa effectiveSizeHint(), setExplicitSizeHint()
setMinimumWidth(), setMinimumHeight()
*/
/*!
\property QSizeF QskControl::maximumSize
\accessors maximumSize(), setMaximumSize()
\sa effectiveSizeHint(), setExplicitSizeHint()
setMaximumWidth(), setMaximumHeight()
*/
/*!
\property QSizeF QskControl::preferredSize
\accessors preferredSize(), setPreferredSize()
\sa effectiveSizeHint(), setExplicitSizeHint(),
setPreferredWidth(), setPreferredHeight()
*/
/*!
\property QSizeF QskControl::sizeConstraint
\accessors sizeConstraint()
*/
/*!
\fn QskControl::QskControl
2021-05-03 12:13:33 +00:00
Initializes the focusPolicy() to Qt::NoFocus and disables
processing of wheel events. The default sizePolicy is
QskSizePolicy::Preferred in vertical and horizontal direction.
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::~QskControl
2021-05-03 12:13:33 +00:00
Destructor
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setMargins( qreal )
2021-04-23 15:31:28 +00:00
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
\param margin Margin for all sides
\aspect QskControl::Control | QskAspect::Metric | QskAspect::Margin
\sa contentsRect(), margins(), QskSkinnable::setMarginHint()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setMargins( const QMarginsF& )
2021-04-23 15:31:28 +00:00
Sets the margins around the contents of the control
\param margins Margins
\aspect QskControl::Control | QskAspect::Metric | QskAspect::Margin
\sa contentsRect(), margins()
\saqt QEvent::ContentsRectChange
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::resetMargins
2021-04-23 15:31:28 +00:00
Reset the margins to the default value provided from the skin
\aspect QskControl::Control | QskAspect::Metric | QskAspect::Margin
\sa contentsRect(), setMargins(), margins()
\saqt QEvent::ContentsRectChange
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::margins() const
2021-04-23 15:31:28 +00:00
\return margins around the contents of the control
\aspect QskControl::Control | QskAspect::Metric | QskAspect::Margin
\sa contentsRect(), setMargins()
\saqt QEvent::ContentsRectChange
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setBackgroundColor
2021-04-23 15:31:28 +00:00
A conveninece method that enables the autoFillBackground property
and sets a solid color as background. Usually used for debugging
layout problems.
\sa setBackground(), setAutoFillBackground()
\sa QskQuickItem::DebugForceBackground
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setBackground
2021-04-23 15:31:28 +00:00
Set the gradient that is used to fill the background,
when autoFillBackground is enabled.
\aspect QskControl::Control | QskAspect::Color
\sa resetBackground(), background(), autoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::resetBackground
2021-04-23 15:31:28 +00:00
Reset the background gradient to the default colors from the skin
\aspect QskControl::Control | QskAspect::Color
\sa setBackground(), background(), autoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::background() const
2021-04-23 15:31:28 +00:00
\return Gradient that is used to fill the background,
when autoFillBackground is enabled.
\aspect QskControl::Control | QskAspect::Color
\sa setBackground(), resetBackground(), autoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::contentsRect
2021-05-03 12:13:33 +00:00
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.
\sa margins(), setMargins(), layoutRect()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::layoutRect
2021-05-03 12:13:33 +00:00
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()
\sa layoutRectForSize(), contentsRect()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::layoutRectForSize
2021-05-03 12:13:33 +00:00
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()
\param size Size Bounding size for the control
\return Area, where to lay out the child items
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::gestureRect
2021-05-03 12:13:33 +00:00
Returns the area where to accept gestures.
The default implementation returns QskQuickItem::rect().
\sa gestureFilter(), gestureEvent()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::focusIndicatorRect
2021-05-03 12:13:33 +00:00
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()
\sa QskFocusIndicator, focusIndicatorClipRect(), focusIndicatorRectChanged()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::focusIndicatorClipRect
2021-05-03 12:13:33 +00:00
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()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::subControlRect( QskAspect::Subcontrol ) const
2021-05-03 12:13:33 +00:00
Calculates the rectangle for a subcontrol from contentsRect().
\param subControl Subcontrol
\return Bounding rectangle for the subControl
\sa QskSkinnable::subControlRect
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::subControlRect( const QSizeF&, QskAspect::Subcontrol ) const
2021-05-03 12:13:33 +00:00
Calculates the rectangle for a subcontrol inside a rectangle at the position
0, 0 for the given size
\param subControl Subcontrol
\param size Size for the control
\return Bounding rectangle for the subControl
\sa QskSkinnable::subControlRect
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::subControlContentsRect( QskAspect::Subcontrol ) const
2021-05-03 12:13:33 +00:00
Calculate the inner rectangle for subControl calculated from contentsRect.
\param subControl Subcontrol
\return Inner rectangle of the subControl
\sa QskSkinnable::subControlContentsRect
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::subControlContentsRect( const QSizeF&, QskAspect::Subcontrol ) const
2021-05-03 12:13:33 +00:00
Calculate the inner rectangle for subControl for a rectangle at the position
0, 0 for the given size
\param subControl Subcontrol
\param size Size for the control
\return Inner rectangle of the subControl
\sa QskSkinnable::subControlContentsRect
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setAutoFillBackground
2021-04-23 15:31:28 +00:00
Set or clear the autoFillBackground property
\sa autoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::autoFillBackground() const
2021-04-23 15:31:28 +00:00
\return Value of the autoFillBackground property
\sa setAutoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setAutoLayoutChildren
2021-04-23 15:31:28 +00:00
Set or clear the autoLayoutChildren property
\sa autoFillBackground()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::autoLayoutChildren() const
2021-04-23 15:31:28 +00:00
\return Value of the autoLayoutChildren property
\sa autoLayoutChildren()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setWheelEnabled
2021-05-03 12:13:33 +00:00
Set or clear the wheelEnabled property
\sa wheelEnabled isWheelEnabled
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::isWheelEnabled
2021-05-03 12:13:33 +00:00
\return Value of the wheelEnabled property
\sa wheelEnabled
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setFocusPolicy
2021-05-03 12:13:33 +00:00
Set the value for the focusPolicy property
\sa focusPolicy()
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::focusPolicy() const
2021-05-03 12:13:33 +00:00
\return Value of the focusPolicy property
\sa focusPolicy(), setFocusPolicy()
2021-03-04 08:15:19 +00:00
*/
/*!
2021-05-03 12:13:33 +00:00
\fn QskControl::setSizePolicy( QskSizePolicy )
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setSizePolicy( QskSizePolicy::Policy, QskSizePolicy::Policy )
*/
/*!
\fn QskControl::setSizePolicy( Qt::Orientation, QskSizePolicy::Policy )
*/
/*!
\fn QskControl::sizePolicy() const
*/
/*!
\fn QskControl::sizePolicy( Qt::Orientation ) const
*/
/*!
\fn QskControl::setLayoutAlignmentHint
*/
/*!
\fn QskControl::layoutAlignmentHint
*/
/*!
\fn QskControl::setLayoutHint
*/
/*!
\fn QskControl::testLayoutHint
*/
/*!
\fn QskControl::setLayoutHints
*/
/*!
\fn QskControl::layoutHints
*/
/*!
\fn QskControl::isVisibleToLayout
2021-05-03 12:13:33 +00:00
Return true, when the control is relevant for layout calculations
A control has an impact on the layout calutaions, when:
- isTransparentForPositioner() is false
- QskQuickItem::isVisibleToParent() is true, or RetainSizeWhenHidden is set
\sa isVisibleToParent(), RetainSizeWhenHidden
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::setMinimumSize( const QSizeF& )
*/
/*!
\fn QskControl::setMinimumSize( qreal, qreal )
*/
/*!
\fn QskControl::setMinimumWidth
*/
/*!
\fn QskControl::setMinimumHeight
*/
/*!
\fn QskControl::setMaximumSize( const QSizeF& )
*/
/*!
\fn QskControl::setMaximumSize( qreal, qreal )
*/
/*!
\fn QskControl::setMaximumWidth
*/
/*!
\fn QskControl::setMaximumHeight
*/
/*!
\fn QskControl::setPreferredSize( const QSizeF& )
*/
/*!
\fn QskControl::setPreferredSize( qreal, qreal )
*/
/*!
\fn QskControl::setPreferredWidth
*/
/*!
\fn QskControl::setPreferredHeight
*/
/*!
\fn QskControl::setFixedSize( const QSizeF& );
*/
/*!
\fn QskControl::setFixedSize( qreal width, qreal height );
*/
/*!
\fn QskControl::setFixedWidth
*/
/*!
\fn QskControl::setFixedHeight
*/
/*!
\fn QskControl::setExplicitSizeHint( Qt::SizeHint, const QSizeF& );
*/
/*!
\fn QskControl::setExplicitSizeHint( Qt::SizeHint, qreal width, qreal height );
*/
2020-12-08 10:02:57 +00:00
2021-03-04 08:15:19 +00:00
/*!
\fn QskControl::resetExplicitSizeHint
*/
/*!
\fn QskControl::minimumSize() const;
*/
2020-12-08 10:02:57 +00:00
2021-03-04 08:15:19 +00:00
/*!
\fn QskControl::maximumSize() const;
*/
/*!
\fn QskControl::preferredSize() const;
*/
2020-12-08 10:02:57 +00:00
2021-03-04 08:15:19 +00:00
/*!
\fn QskControl::explicitSizeHint
*/
/*!
\fn QskControl::implicitSizeHint
*/
/*!
\fn QskControl::sizeHint
*/
/*!
\fn QskControl::heightForWidth
2020-12-08 10:02:57 +00:00
2021-03-04 08:15:19 +00:00
*/
/*!
\fn QskControl::widthForHeight
*/
/*!
\fn QskControl::effectiveSizeHint
*/
/*!
\fn QskControl::sizeConstraint( Qt::SizeHint, const QSizeF& ) const
*/
/*!
\fn QskControl::sizeConstraint() const
*/
/*!
\fn QskControl::locale() const
*/
/*!
\fn QskControl::resetLocale
*/
/*!
\fn QskControl::subControls
*/
/*!
\fn void QskControl::backgroundChanged
*/
/*!
\fn void QskControl::marginsChanged
*/
/*!
\fn void QskControl::focusIndicatorRectChanged
*/
/*!
\fn void QskControl::localeChanged
*/
/*!
\fn void QskControl::focusPolicyChanged
*/
/*!
\fn void QskControl::wheelEnabledChanged
*/
/*!
\fn void QskControl::setLocale
*/
/*!
\fn bool QskControl::event
*/
/*!
\fn virtual void QskControl::gestureEvent
*/
/*!
\fn void QskControl::hoverEnterEvent
*/
/*!
\fn void QskControl::hoverLeaveEvent
*/
/*!
\fn bool QskControl::childMouseEventFilter
*/
/*!
\fn virtual bool QskControl::gestureFilter
*/
/*!
\fn void QskControl::itemChange
*/
/*!
\fn void QskControl::geometryChange
*/
/*!
\fn void QskControl::initSizePolicy
*/
/*!
\fn virtual void QskControl::updateResources
*/
/*!
\fn virtual void QskControl::updateLayout
*/
/*!
\fn virtual QSizeF QskControl::contentsSizeHint
*/
/*!
\fn virtual QSizeF QskControl::layoutSizeHint
2020-12-08 10:02:57 +00:00
*/