qskinny/doc/classes/QskSkinnable.dox

444 lines
9.9 KiB
Plaintext
Raw Normal View History

2020-12-08 10:02:57 +00:00
/*!
2020-12-12 13:05:09 +00:00
\class QskSkinnable QskSkinnable.h
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
\ingroup Framework
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
QskSkinnable is the base for all objects, that can be configured by skin hints
2021-02-16 11:19:05 +00:00
and are displayed by a skinlet. The configuration from the skin can be overwritten by
adding values to the local skin hint table - it is even possible to replace the
skinlet individually.
In most cases a skinnable is a QskControl, but conceptually it is
possible to have controls, that consist of many skinnables.
\sa QskSkin, QskSkinlet, QskControl, QskSkinHintTable
*/
/*! \fn QskSkinnable::QskSkinnable()
Constructs a skinnable where all settings will be resolved from the skin
\sa effectiveSkin(), effectiveSkinlet, effectiveSkinHint
*/
/*! \fn QskSkinnable::~QskSkinnable()
Called when the skinnable is destroyed.
2020-12-12 13:05:09 +00:00
*/
2020-12-08 10:02:57 +00:00
2020-12-12 13:05:09 +00:00
/*!
2021-02-11 11:46:19 +00:00
\fn void QskSkinnable::setSkinlet
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
\brief Set an individual skinlet to render/display the content
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
Usually all skinnables of the same type are rendered by the same instance
of a skinlet. For rare situations it can be useful to assign a different skinlet.
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
When QskSkinlet::isOwnedBySkinnable() is true, the skinlet will be deleted,
when the skinnable is deleted or a different skinlet gets assigned.
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
\param skinlet Skinlet to render/layout the skinnable.
\sa skinlet(), effectiveSkinlet(), resetSkinlet(),
QskSkin::declareSkinlet, QskSkinlet::isOwnedBySkinnable()
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
\note Overriding the skinlet that has been registered in the skin
breaks the themeabilty of the skinnable.
2020-12-12 13:05:09 +00:00
*/
2020-12-08 10:02:57 +00:00
2020-12-12 13:05:09 +00:00
/*!
2021-02-11 11:46:19 +00:00
\fn QskSkinnable::skinlet
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
\return Skinlet, that has been assigned by setSkinlet(). Usually the skinnable
is coupled to a default skinlet from the skin and the result is a nullptr.
\sa setSkinlet(), effectiveSkinlet(), effectiveSkin()
2020-12-12 13:05:09 +00:00
*/
2020-12-08 10:02:57 +00:00
2020-12-12 13:05:09 +00:00
/*!
2021-02-11 11:46:19 +00:00
\fn QskSkinnable::updateNode
2020-12-08 10:02:57 +00:00
2021-01-25 10:06:01 +00:00
This method replaces the QQuickItem::updatePaintNode method as the
preferred paint method to override when subclassing QskControl. This allows
QskControl to perform some additional steps before calling updateNode(),
and provides a consistent parent node which subclasses can rely on.
2020-12-08 10:02:57 +00:00
2021-02-11 11:46:19 +00:00
The default implementation simply forwards the operation to the skinlet,
2020-12-08 10:02:57 +00:00
2021-01-25 10:06:01 +00:00
\param parentNode The parent of the nodes to be added in this method.
2021-02-11 11:46:19 +00:00
\note Overriding updateNode() might break the themeability and the usual
strategy to implement custom painting is to customize or replace
the skinlet.
\sa QskSkinlet::updateSubNode()
*/
/*!
\fn QskSkinnable::effectiveSkinHint
\brief Find the value for a specific aspect
\param aspect Initial aspect, to feed the skin hint lookup algorithm.
\param status Optional status information, that indicates how the aspect has been
resolved and where the result has been found
\sa effectiveSubcontrol(), effectivePlacement()
*/
2021-02-16 11:19:05 +00:00
/*! \fn QskSkinnable::effectiveFont
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
Finds the font role for the given aspect and returns
the corrsponding font from the font table of the skin.
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\param aspect Unresolved aspect
\return Font, corresponding to the resolved aspect
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\sa fontRoleHint(), effectiveSkinHint(), QskSkin::font()
2021-02-11 11:46:19 +00:00
*/
2021-02-16 11:19:05 +00:00
/*! \fn QskSkinnable::effectiveGraphicFilter
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
Finds the graphic role for the given aspect and returns
the corrsponding color filter from the skin
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\param aspect Unresolved aspect
\return Color filter, corresponding to the resolved aspect
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\sa graphicRoleHint(), effectiveSkinHint(), QskSkin::graphicFilter()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::setAnimationHint
2021-02-16 11:19:05 +00:00
Insert an animation hint into the local hint table
\param aspect Unresolved aspect
\param hint Animation hint
\sa animationHint(), effectiveAnimation()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::animationHint
2021-02-16 11:19:05 +00:00
*/
/*! \fn QskSkinnable::effectiveAnimation
Retrieve the configuration of the animator for reaching
a specific state.
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\param type Metric, color or something else
\param subControl Unsubstituted subControl
\param state State bits
\param status If status != nullptr additional informations
about where the hint has been found is returned
\return Value from the hint tables
\sa animationHint()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::setSkinHint
2021-02-16 11:19:05 +00:00
Insert a hint into the local hint table
\param aspect Unresolved aspect
\param hint Hint, might be anything that fits into a QVariant
and is understood by the skinlet consuming it.
\sa effectiveSkinHint(), resetSkinHint(), QskSkinHintTable::setHint()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::resetSkinHint
2021-02-16 11:19:05 +00:00
Remove a hint from the local hint table
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
After removing the hint from the local table the hint will
be resolved fro the hint table of the skin.
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\param aspect Unresolved aspect
\sa setSkinHint(), effectiveSkinHint()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::effectivePlacement
*/
/*! \fn QskSkinnable::hintStatus
2021-02-16 11:19:05 +00:00
\param aspect Unresolved aspect
\return Informations about how the aspect would be resolved
\sa effectiveSkinHint()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::skinState
2021-02-16 11:19:05 +00:00
\return Current state
\sa setSkinStateFlag(), setSkinState()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::skinStateAsPrintable() const
2021-02-16 11:19:05 +00:00
\return Current state as printable for debugging purposes
\sa skinStateAsPrintable( QskAspect::State ) const
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::skinStateAsPrintable( QskAspect::State ) const
2021-02-16 11:19:05 +00:00
\param state State bits
\return state as printable for debugging purposes
\note A pointer to an internal buffer is returned, that might be
overwritten by subsequent calls.
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::subControlRect
2021-02-16 11:19:05 +00:00
The same as
\code effectiveSkinlet()->subControlRect( this, contentsRect, subControl ); \endcode
\param contentsRect Bounding contents rectangle
\param subControl Subcontrol
\sa effectiveSkinlet(), QskSkinlet::subControlRect(), QskControl::contentsRect()
2021-02-11 11:46:19 +00:00
*/
2021-02-16 11:19:05 +00:00
/*! \fn QskSkinnable::subControlContentsRect
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::outerBoxSize
*/
/*! \fn QskSkinnable::innerBoxSize
*/
/*! \fn QskSkinnable::innerBox
*/
/*! \fn QskSkinnable::outerBox
*/
/*! \fn QskSkinnable::innerPadding
*/
/*! \fn QskSkinnable::effectiveSkinlet
2021-02-16 11:19:05 +00:00
\return Skinlet that has been set with setSkinlet() - or the default
skinlet from the skin, that had been registered for metaObject()
2021-02-11 11:46:19 +00:00
*/
2021-02-16 11:19:05 +00:00
2021-02-11 11:46:19 +00:00
/*! \fn QskSkinnable::effectiveSkin
2021-02-16 11:19:05 +00:00
\return Almost always the current skin. The only exception is when manually
setting a skinlet being created from a different skin.
\sa QskSetup::skin(), QskSkinlet::skin()
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::startTransition
*/
/*! \fn QskSkinnable::effectiveSubcontrol
*/
/*! \fn QskSkinnable::controlCast()
2021-02-16 11:19:05 +00:00
Safe casting of the skinnable to a QskControl
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
The operation is based on comparing metaObject()
with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
\return Control if successful, or a nullptr otherwise
2021-02-11 11:46:19 +00:00
*/
2021-02-16 11:19:05 +00:00
/*! \fn QskSkinnable::controlCast() const
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
Safe casting of the skinnable to a QskControl
2021-02-11 11:46:19 +00:00
2021-02-16 11:19:05 +00:00
The operation is based on comparing metaObject()
with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
\return Control if successful, or a nullptr otherwise
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::owningControl
2021-02-16 11:19:05 +00:00
In most cases a skinnable is one of the base classes of QskControl and
the owning control is the derived control. But in case of a control, that
is built from several skinnables this pure virtual method needs to be implemented.
\return QskControl, that is owner of the skinnable. In most
cases the skinnable is inherited
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::metaObject
*/
/*! \fn QskSkinnable::debug( QskAspect ) const
*/
/*! \fn QskSkinnable::debug( QskAspect::State ) const
*/
/*! \fn QskSkinnable::debug( QDebug, QskAspect ) const
*/
/*! \fn QskSkinnable::debug( QDebug, QskAspect::State ) const
*/
/*! \fn QskSkinnable::setSkinState
*/
/*! \fn QskSkinnable::setSkinStateFlag
*/
/*! \fn QskSkinnable::setColor( QskAspect, Qt::GlobalColor )
*/
/*! \fn QskSkinnable::setColor( QskAspect, QRgb )
*/
/*! \fn QskSkinnable::setColor( QskAspect, const QColor& )
*/
/*! \fn QskSkinnable::resetColor
*/
/*! \fn QskSkinnable::color
*/
/*! \fn QskSkinnable::setMetric
*/
/*! \fn QskSkinnable::resetMetric
*/
/*! \fn QskSkinnable::metric
*/
/*! \fn QskSkinnable::setFlagHint
*/
/*! \fn QskSkinnable::resetFlagHint
*/
/*! \fn QskSkinnable::flagHint( QskAspect ) const
*/
/*! \fn template< typename T > T QskSkinnable::flagHint( QskAspect, T ) const
*/
2021-02-16 11:19:05 +00:00
/*! \fn QskSkinnable::setStrutSizeHint( QskAspect, const QSizeF& )
2021-02-11 11:46:19 +00:00
*/
/*! \fn QskSkinnable::setStrutSizeHint( QskAspect, qreal width, qreal height )
*/
/*! \fn QskSkinnable::resetStrutSizeHint
*/
/*! \fn QskSkinnable::strutSizeHint
*/
/*! \fn QskSkinnable::setMarginHint( QskAspect, qreal )
*/
/*! \fn QskSkinnable::setMarginHint( QskAspect, const QMarginsF& )
*/
/*! \fn QskSkinnable::resetMarginHint
*/
/*! \fn QskSkinnable::marginHint
*/
/*! \fn QskSkinnable::setPaddingHint( QskAspect, qreal )
*/
/*! \fn QskSkinnable::setPaddingHint( QskAspect, const QMarginsF& )
*/
/*! \fn QskSkinnable::resetPaddingHint
*/
/*! \fn QskSkinnable::paddingHint
*/
/*! \fn QskSkinnable::setGradientHint
*/
/*! \fn QskSkinnable::gradientHint
*/
/*! \fn QskSkinnable::setBoxShapeHint
*/
/*! \fn QskSkinnable::resetBoxShapeHint
*/
/*! \fn QskSkinnable::boxShapeHint
*/
/*! \fn QskSkinnable::setBoxBorderMetricsHint
*/
/*! \fn QskSkinnable::resetBoxBorderMetricsHint
*/
/*! \fn QskSkinnable::boxBorderMetricsHint
*/
/*! \fn QskSkinnable::setBoxBorderColorsHint
*/
/*! \fn QskSkinnable::resetBoxBorderColorsHint
*/
/*! \fn QskSkinnable::boxBorderColorsHint
*/
/*! \fn QskSkinnable::setSpacingHint
*/
/*! \fn QskSkinnable::resetSpacingHint
*/
/*! \fn QskSkinnable::spacingHint
*/
/*! \fn QskSkinnable::setAlignmentHint
*/
/*! \fn QskSkinnable::resetAlignmentHint
*/
/*! \fn QskSkinnable::alignmentHint
*/
/*! \fn QskSkinnable::setFontRoleHint
*/
/*! \fn QskSkinnable::resetFontRoleHint
*/
/*! \fn QskSkinnable::fontRoleHint
*/
/*! \fn QskSkinnable::setGraphicRoleHint
*/
/*! \fn QskSkinnable::resetGraphicRoleHint
*/
/*! \fn QskSkinnable::graphicRoleHint
*/
/*! \fn QskSkinnable::isTransitionAccepted
*/
/*! \fn QskSkinnable::hintTable()
*/
/*! \fn QskSkinnable::hintTable() const
2020-12-12 13:05:09 +00:00
*/