QSkinny 0.8.0
C++/Qt UI toolkit
|
#include <QskSkinnable.h>
QskSkinnable is the base for all objects, that can be configured by skin hints 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.
Definition at line 79 of file QskSkinnable.h.
Public Member Functions | |
QskSkinnable () | |
virtual | ~QskSkinnable () |
void | setSkinlet (const QskSkinlet *) |
Set an individual skinlet to render/display the content. | |
const QskSkinlet * | skinlet () const |
QFont | effectiveFont (QskAspect) const |
qreal | effectiveFontHeight (QskAspect) const |
QskColorFilter | effectiveGraphicFilter (QskAspect::Subcontrol) const |
void | setSubcontrolProxy (QskAspect::Subcontrol, QskAspect::Subcontrol proxy) |
void | resetSubcontrolProxy (QskAspect::Subcontrol) |
QskAspect::Subcontrol | subcontrolProxy (QskAspect::Subcontrol) const |
bool | setAnimationHint (QskAspect, QskAnimationHint) |
QskAnimationHint | animationHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | hasAnimationHint (QskAspect) const |
bool | setSkinHint (QskAspect, const QVariant &) |
Insert a hint into the local hint table. | |
bool | resetSkinHint (QskAspect) |
Remove a hint from the local hint table. | |
bool | moveSkinHint (QskAspect, const QVariant &) |
bool | moveSkinHint (QskAspect, const QVariant &, const QVariant &) |
QskAnimationHint | effectiveAnimation (QskAspect::Type, QskAspect::Subcontrol, QskAspect::States, QskSkinHintStatus *status=nullptr) const |
QVariant | effectiveSkinHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Find the value for a specific aspect. | |
virtual QskAspect::Variation | effectiveVariation () const |
virtual QskAspect::Section | section () const |
QskSkinHintStatus | hintStatus (QskAspect) const |
QRectF | subControlRect (const QRectF &, QskAspect::Subcontrol) const |
Calculate position and size of a subControl. | |
QRectF | subControlContentsRect (const QRectF &, QskAspect::Subcontrol) const |
Calculate the inner rectangle for subControl. | |
QSizeF | outerBoxSize (QskAspect, const QSizeF &innerBoxSize) const |
Calculate the size, when being expanded by paddings, indentations. | |
QSizeF | innerBoxSize (QskAspect, const QSizeF &outerBoxSize) const |
Calculate the size, with paddings, indentations being subtracted. | |
QRectF | innerBox (QskAspect, const QRectF &outerBox) const |
Calculate the rectangle, whith paddings, indentations being subtracted. | |
QRectF | outerBox (QskAspect, const QRectF &innerBox) const |
Calculate the rectangle, when being expanded by paddings, indentations. | |
QMarginsF | innerPadding (QskAspect, const QSizeF &) const |
Calculate the padding from attributes for the given aspect. | |
const QskSkinlet * | effectiveSkinlet () const |
QskSkin * | effectiveSkin () const |
void | startTransition (QskAspect, QskAnimationHint, const QVariant &from, const QVariant &to) |
void | startTransition (QskAspect, int index, QskAnimationHint, const QVariant &from, const QVariant &to) |
QskAspect::Subcontrol | effectiveSubcontrol (QskAspect::Subcontrol) const |
QskControl * | controlCast () |
const QskControl * | controlCast () const |
virtual QQuickItem * | owningItem () const =0 |
virtual const QMetaObject * | metaObject () const =0 |
void | debug (QskAspect) const |
void | debug (QskAspect::State) const |
void | debug (QDebug, QskAspect) const |
void | debug (QDebug, QskAspect::State) const |
void | setSkinStates (QskAspect::States) |
void | setSkinStateFlag (QskAspect::State, bool on=true) |
void | addSkinStates (QskAspect::States) |
void | clearSkinStates (QskAspect::States) |
bool | hasSkinState (QskAspect::State) const |
QskAspect::States | skinStates () const |
const char * | skinStatesAsPrintable () const |
const char * | skinStatesAsPrintable (QskAspect::States) const |
bool | setColor (QskAspect, Qt::GlobalColor) |
Sets a color hint. | |
bool | setColor (QskAspect, QRgb) |
Sets a color hint. | |
bool | setColor (QskAspect, const QColor &) |
Sets a color hint. | |
bool | moveColor (QskAspect, Qt::GlobalColor) |
bool | moveColor (QskAspect, QRgb) |
bool | moveColor (QskAspect, const QColor &) |
bool | resetColor (QskAspect) |
Removes a color hint from the local table. | |
QColor | color (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a color hint. | |
bool | setMetric (QskAspect, qreal) |
Sets a metric hint. | |
bool | moveMetric (QskAspect, qreal) |
bool | resetMetric (QskAspect) |
Removes a metric hint from the local table. | |
qreal | metric (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a metric hint. | |
bool | setFlagHint (QskAspect, int flag) |
Sets a flag hint. | |
template<typename T > | |
T | flagHint (QskAspect, T=T()) const |
Retrieves a flag hint. | |
bool | setPositionHint (QskAspect, qreal) |
bool | movePositionHint (QskAspect, qreal) |
bool | movePositionHint (QskAspect, qreal from, qreal to) |
bool | resetPositionHint (QskAspect) |
qreal | positionHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | setStrutSizeHint (QskAspect, const QSizeF &) |
Sets a metric hint. | |
bool | setStrutSizeHint (QskAspect, qreal width, qreal height) |
Sets a strut size hint. | |
bool | resetStrutSizeHint (QskAspect) |
Removes a strut size hint from the local table. | |
QSizeF | strutSizeHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a strut size hint. | |
bool | setMarginHint (QskAspect, qreal) |
Sets a margin hint. | |
bool | setMarginHint (QskAspect, const QMarginsF &) |
Sets a margin hint. | |
bool | resetMarginHint (QskAspect) |
Removes a margin hint from the local table. | |
QMarginsF | marginHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a margin hint. | |
bool | setPaddingHint (QskAspect, qreal) |
Sets a padding hint. | |
bool | setPaddingHint (QskAspect, const QMarginsF &) |
Sets a padding hint. | |
bool | resetPaddingHint (QskAspect) |
Removes a padding hint from the local table. | |
QMarginsF | paddingHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a padding hint. | |
bool | setGradientHint (QskAspect, const QskGradient &) |
Sets a gradient as color hint. | |
QskGradient | gradientHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a color hint as gradient. | |
bool | setBoxShapeHint (QskAspect, const QskBoxShapeMetrics &) |
Sets a shape hint. | |
bool | resetBoxShapeHint (QskAspect) |
Removes a shape hint from the local table. | |
QskBoxShapeMetrics | boxShapeHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a shape hint. | |
bool | setBoxBorderMetricsHint (QskAspect, const QskBoxBorderMetrics &) |
Sets a border metrics hint. | |
bool | resetBoxBorderMetricsHint (QskAspect) |
Removes a border metrics hint from the local table. | |
QskBoxBorderMetrics | boxBorderMetricsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a border hint. | |
bool | setBoxBorderColorsHint (QskAspect, const QskBoxBorderColors &) |
Sets a border colors hint. | |
bool | resetBoxBorderColorsHint (QskAspect) |
Removes a border colors hint from the local table. | |
QskBoxBorderColors | boxBorderColorsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves border colors hint. | |
bool | setShadowMetricsHint (QskAspect, const QskShadowMetrics &) |
bool | resetShadowMetricsHint (QskAspect) |
QskShadowMetrics | shadowMetricsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | setShadowColorHint (QskAspect, const QColor &) |
bool | resetShadowColorHint (QskAspect) |
QColor | shadowColorHint (QskAspect, QskSkinHintStatus *=nullptr) const |
QskBoxHints | boxHints (QskAspect) const |
bool | setArcMetricsHint (QskAspect, const QskArcMetrics &) |
bool | resetArcMetricsHint (QskAspect) |
QskArcMetrics | arcMetricsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | setStippleMetricsHint (QskAspect, const QskStippleMetrics &) |
bool | resetStippleMetricsHint (QskAspect) |
QskStippleMetrics | stippleMetricsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | setSpacingHint (QskAspect, qreal) |
Sets a spacing hint. | |
bool | resetSpacingHint (QskAspect) |
Removes a spacing hint from the local table. | |
qreal | spacingHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a spacing hint. | |
bool | setAlignmentHint (QskAspect, Qt::Alignment) |
Sets an alignment hint. | |
bool | resetAlignmentHint (QskAspect) |
Removes an alignment hint from the local table. | |
Qt::Alignment | alignmentHint (QskAspect, Qt::Alignment=Qt::Alignment()) const |
Retrieves an alignment hint. | |
bool | setTextOptionsHint (QskAspect, const QskTextOptions &) |
bool | resetTextOptionsHint (QskAspect) |
QskTextOptions | textOptionsHint (QskAspect, QskSkinHintStatus *=nullptr) const |
bool | setFontRoleHint (QskAspect, const QskFontRole &) |
Sets a font role hint. | |
bool | resetFontRoleHint (QskAspect) |
Removes a font role hint from the local table. | |
QskFontRole | fontRoleHint (QskAspect, QskSkinHintStatus *=nullptr) const |
Retrieves a font role hint. | |
bool | setGraphicRoleHint (QskAspect, int role) |
Sets a graphic role hint. | |
bool | resetGraphicRoleHint (QskAspect) |
Removes a graphic role hint from the local table. | |
int | graphicRoleHint (QskAspect, QskSkinHintStatus *=nullptr) const |
A Retrieves a graphic role hint. | |
bool | setSymbolHint (const QskAspect, const QskGraphic &) |
bool | resetSymbolHint (const QskAspect) |
QskGraphic | symbolHint (const QskAspect, QskSkinHintStatus *=nullptr) const |
const QskSkinHintTable & | hintTable () const |
Accessor for local skin hint table. | |
bool | startHintTransitions (QskAspect::States, QskAspect::States, int index=-1) |
bool | startHintTransitions (const QVector< QskAspect::Subcontrol > &, QskAspect::States, QskAspect::States, int index=-1) |
const QskHintAnimator * | runningHintAnimator (QskAspect, int index=-1) const |
Protected Member Functions | |
virtual void | updateNode (QSGNode *) |
virtual bool | isTransitionAccepted (QskAspect) const |
Additional check if an transition should be started. | |
virtual QskAspect::Subcontrol | substitutedSubcontrol (QskAspect::Subcontrol) const |
QskSkinHintTable & | hintTable () |
Accessor for local skin hint table. | |
QskSkinnable::QskSkinnable | ( | ) |
Constructs a skinnable where all settings will be resolved from the skin
Definition at line 263 of file QskSkinnable.cpp.
|
virtual |
Called when the skinnable is destroyed.
Definition at line 268 of file QskSkinnable.cpp.
void QskSkinnable::addSkinStates | ( | QskAspect::States | states | ) |
Definition at line 1403 of file QskSkinnable.cpp.
|
inline |
Retrieves an alignment hint.
QskAspect::Flag | QskAspect::Alignment will be added to aspect.
aspect | Unresolved aspect |
defaultAlignment | Default value |
Definition at line 304 of file QskSkinnable.h.
QskAnimationHint QskSkinnable::animationHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieve the configuration of the animator for the current state.
aspect | Unresolved aspect |
status | If status != nullptr additional information about where the hint has been found is returned |
Definition at line 863 of file QskSkinnable.cpp.
QskArcMetrics QskSkinnable::arcMetricsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 648 of file QskSkinnable.cpp.
QskBoxBorderColors QskSkinnable::boxBorderColorsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves border colors hint.
QskAspect::Color | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 589 of file QskSkinnable.cpp.
QskBoxBorderMetrics QskSkinnable::boxBorderMetricsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a border hint.
QskAspect::Metric | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 571 of file QskSkinnable.cpp.
QskBoxHints QskSkinnable::boxHints | ( | QskAspect | aspect | ) | const |
Definition at line 629 of file QskSkinnable.cpp.
QskBoxShapeMetrics QskSkinnable::boxShapeHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a shape hint.
QskAspect::Metric | QskAspect::Shape will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 553 of file QskSkinnable.cpp.
void QskSkinnable::clearSkinStates | ( | QskAspect::States | states | ) |
Definition at line 1408 of file QskSkinnable.cpp.
QColor QskSkinnable::color | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a color hint.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 420 of file QskSkinnable.cpp.
QskControl * QskSkinnable::controlCast | ( | ) |
Safe casting of the skinnable to a QskControl
The operation is based on comparing metaObject() with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
Definition at line 1592 of file QskSkinnable.cpp.
const QskControl * QskSkinnable::controlCast | ( | ) | const |
Safe casting of the skinnable to a QskControl
The operation is based on comparing metaObject() with QskControl::staticMetaObject() ( similar to what qobject_cast() does )
Definition at line 1598 of file QskSkinnable.cpp.
void QskSkinnable::debug | ( | QDebug | debug, |
QskAspect | aspect | ||
) | const |
Writes an aspect to a stream using the string conversions for metaObject()
debug | Debug stream |
aspect | Aspect to be printed |
Definition at line 1604 of file QskSkinnable.cpp.
void QskSkinnable::debug | ( | QDebug | debug, |
QskAspect::State | state | ||
) | const |
Writes a state to a stream using the string conversions for metaObject()
debug | Debug stream |
state | State to be printed |
Definition at line 1609 of file QskSkinnable.cpp.
void QskSkinnable::debug | ( | QskAspect | aspect | ) | const |
Writes an aspect to qDebug() using the string conversions for metaObject()
aspect | Aspect to be printed |
Definition at line 1614 of file QskSkinnable.cpp.
void QskSkinnable::debug | ( | QskAspect::State | state | ) | const |
Writes a state to qDebug() using the string conversions for metaObject()
state | State to be printed |
Definition at line 1619 of file QskSkinnable.cpp.
QskAnimationHint QskSkinnable::effectiveAnimation | ( | QskAspect::Type | type, |
QskAspect::Subcontrol | subControl, | ||
QskAspect::States | states, | ||
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieve the configuration of the animator for reaching a specific state.
type | Metric, color or something else |
subControl | Unsubstituted subControl |
state | State bits |
status | If status != nullptr additional information about where the hint has been found is returned |
Definition at line 875 of file QskSkinnable.cpp.
QFont QskSkinnable::effectiveFont | ( | QskAspect | aspect | ) | const |
Finds the font role for the given aspect and returns the corresponding font from the font table of the skin.
aspect | Unresolved aspect |
Definition at line 727 of file QskSkinnable.cpp.
qreal QskSkinnable::effectiveFontHeight | ( | QskAspect | aspect | ) | const |
Definition at line 759 of file QskSkinnable.cpp.
QskColorFilter QskSkinnable::effectiveGraphicFilter | ( | QskAspect::Subcontrol | subControl | ) | const |
Finds the graphic role for the given aspect and returns the corresponding color filter from the skin
aspect | Unresolved aspect |
Definition at line 801 of file QskSkinnable.cpp.
QskSkin * QskSkinnable::effectiveSkin | ( | ) | const |
Definition at line 1541 of file QskSkinnable.cpp.
QVariant QskSkinnable::effectiveSkinHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Find the value for a specific aspect.
If an animation is running for the given aspect its value will be returned as hint. Then effectiveSkinHint() tries to find a hint in the local table and finally tries to resolve the aspect from the hint table of the skin.
aspect | Initial aspect, to feed the skin hint lookup algorithm. |
status | Optional status information |
Definition at line 953 of file QskSkinnable.cpp.
const QskSkinlet * QskSkinnable::effectiveSkinlet | ( | ) | const |
Definition at line 307 of file QskSkinnable.cpp.
QskAspect::Subcontrol QskSkinnable::effectiveSubcontrol | ( | QskAspect::Subcontrol | subControl | ) | const |
Subcontrol substitution is a mechanism, that is used when a variation of an existing control needs to have skin hints, that can be configured individually without having to reimplement a new skinlet.
F.e. a button on a toolbar is often flat with a hovering effect. In this case a tool button could be derived from QskPushButton, where the QskPushButton::Panel subcontrol gets substituted by a new subcontrol that is defined for the tool button.
Subcontrol substitution is part of a concept that is known as aspect resolving "aspect resolving".
subControl | Subcontrol |
The default implementation is a no operation and does not substitute
Definition at line 1572 of file QskSkinnable.cpp.
|
virtual |
The variation bits are added to an unresolved aspect when inserting or looking up values in the hint table.
Reimplemented in QskPageIndicator, QskProgressBar, QskProgressRing, QskPushButton, QskSegmentedBar, QskSeparator, QskSlider, QskSwitchButton, QskTabBar, QskTabButton, and QskTabView.
Definition at line 1557 of file QskSkinnable.cpp.
|
inline |
Retrieves a flag hint.
aspect | Unresolved aspect |
status | Optional status information |
aspect | Unresolved aspect |
defaultValue | Default result, when no entry can be found in the hint tables |
Definition at line 295 of file QskSkinnable.h.
QskFontRole QskSkinnable::fontRoleHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a font role hint.
QskAspect::Flag | QskAspect::FontRole will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 720 of file QskSkinnable.cpp.
QskGradient QskSkinnable::gradientHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a color hint as gradient.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 536 of file QskSkinnable.cpp.
int QskSkinnable::graphicRoleHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
A Retrieves a graphic role hint.
QskAspect::Flag | QskAspect::GraphicRole will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 775 of file QskSkinnable.cpp.
bool QskSkinnable::hasAnimationHint | ( | QskAspect | aspect | ) | const |
Definition at line 870 of file QskSkinnable.cpp.
bool QskSkinnable::hasSkinState | ( | QskAspect::State | state | ) | const |
Definition at line 1187 of file QskSkinnable.cpp.
QskSkinHintStatus QskSkinnable::hintStatus | ( | QskAspect | aspect | ) | const |
aspect | Unresolved aspect |
Definition at line 988 of file QskSkinnable.cpp.
|
protected |
Accessor for local skin hint table.
Definitions in the local hint table have precedence over those from the table of the skin. Initially the local table is empty.
Definition at line 365 of file QskSkinnable.cpp.
const QskSkinHintTable & QskSkinnable::hintTable | ( | ) | const |
Accessor for local skin hint table.
Definitions in the local hint table have precedence over those from the table of the skin. Initially the local table is empty.
Definition at line 370 of file QskSkinnable.cpp.
QRectF QskSkinnable::innerBox | ( | QskAspect | aspect, |
const QRectF & | outerBox | ||
) | const |
Calculate the rectangle, whith paddings, indentations being subtracted.
Paddings, indentations depend on attributes for the given aspect.
aspect | Unresolved aspect |
outerBox | Rectangle to be shrunk |
Definition at line 1273 of file QskSkinnable.cpp.
QSizeF QskSkinnable::innerBoxSize | ( | QskAspect | aspect, |
const QSizeF & | outerBoxSize | ||
) | const |
Calculate the size, with paddings, indentations being subtracted.
Paddings, indentations depend on attributes for the given aspect.
aspect | Unresolved aspect |
outerBoxSize | Size to be shrunk |
Definition at line 1264 of file QskSkinnable.cpp.
QMarginsF QskSkinnable::innerPadding | ( | QskAspect | aspect, |
const QSizeF & | outerBoxSize | ||
) | const |
Calculate the padding from attributes for the given aspect.
Beside padding hints, the radii of the shape might have an effect
aspect | Unresolved aspect |
outerBoxSize | Size of the box |
Definition at line 1258 of file QskSkinnable.cpp.
|
protectedvirtual |
Additional check if an transition should be started.
In certain situations a transition initiated from state depending hints needs to be avoided.
aspect | Aspect |
Reimplemented in QskPopup.
Definition at line 1306 of file QskSkinnable.cpp.
QMarginsF QskSkinnable::marginHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a margin hint.
QskAspect::Metric | QskAspect::Margin will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 503 of file QskSkinnable.cpp.
|
pure virtual |
qreal QskSkinnable::metric | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a metric hint.
QskAspect::Metric will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 435 of file QskSkinnable.cpp.
bool QskSkinnable::moveColor | ( | QskAspect | aspect, |
const QColor & | color | ||
) |
Definition at line 405 of file QskSkinnable.cpp.
bool QskSkinnable::moveColor | ( | QskAspect | aspect, |
QRgb | rgb | ||
) |
Definition at line 415 of file QskSkinnable.cpp.
bool QskSkinnable::moveColor | ( | QskAspect | aspect, |
Qt::GlobalColor | color | ||
) |
Definition at line 410 of file QskSkinnable.cpp.
bool QskSkinnable::moveMetric | ( | QskAspect | aspect, |
qreal | metric | ||
) |
Definition at line 430 of file QskSkinnable.cpp.
bool QskSkinnable::movePositionHint | ( | QskAspect | aspect, |
qreal | from, | ||
qreal | to | ||
) |
Definition at line 450 of file QskSkinnable.cpp.
bool QskSkinnable::movePositionHint | ( | QskAspect | aspect, |
qreal | position | ||
) |
Definition at line 445 of file QskSkinnable.cpp.
bool QskSkinnable::moveSkinHint | ( | QskAspect | aspect, |
const QVariant & | value | ||
) |
Definition at line 1017 of file QskSkinnable.cpp.
bool QskSkinnable::moveSkinHint | ( | QskAspect | aspect, |
const QVariant & | oldValue, | ||
const QVariant & | newValue | ||
) |
Definition at line 996 of file QskSkinnable.cpp.
QRectF QskSkinnable::outerBox | ( | QskAspect | aspect, |
const QRectF & | innerBox | ||
) | const |
Calculate the rectangle, when being expanded by paddings, indentations.
Paddings, indentations depend on attributes for the given aspect.
aspect | Unresolved aspect |
innerBox | Rectangle to be expanded |
The size hint for a "container" node usually depend on the hints of its inner nodes. F.e the size hint for QskPushButton::Panel depends on the size hints of QskPushButton::Text and QskPushButton::Graphic.
Definition at line 1287 of file QskSkinnable.cpp.
QSizeF QskSkinnable::outerBoxSize | ( | QskAspect | aspect, |
const QSizeF & | innerBoxSize | ||
) | const |
Calculate the size, when being expanded by paddings, indentations.
Paddings, indentations depend on attributes for the given aspect.
aspect | Unresolved aspect |
innerBoxSize | Size to be expanded |
The size hint for a "container" node usually depend on the hints of its inner nodes. F.e the size hint for QskPushButton::Panel depends on the size hints of QskPushButton::Text and QskPushButton::Graphic.
Definition at line 1280 of file QskSkinnable.cpp.
QMarginsF QskSkinnable::paddingHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a padding hint.
QskAspect::Metric | QskAspect::Padding will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 524 of file QskSkinnable.cpp.
qreal QskSkinnable::positionHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 461 of file QskSkinnable.cpp.
bool QskSkinnable::resetAlignmentHint | ( | QskAspect | aspect | ) |
Removes an alignment hint from the local table.
QskAspect::Flag | QskAspect::Alignment will be added to aspect.
aspect | Unresolved aspect |
Definition at line 385 of file QskSkinnable.cpp.
bool QskSkinnable::resetArcMetricsHint | ( | QskAspect | aspect | ) |
Definition at line 643 of file QskSkinnable.cpp.
bool QskSkinnable::resetBoxBorderColorsHint | ( | QskAspect | aspect | ) |
Removes a border colors hint from the local table.
QskAspect::Color | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
Definition at line 584 of file QskSkinnable.cpp.
bool QskSkinnable::resetBoxBorderMetricsHint | ( | QskAspect | aspect | ) |
Removes a border metrics hint from the local table.
QskAspect::Metric | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
Definition at line 566 of file QskSkinnable.cpp.
bool QskSkinnable::resetBoxShapeHint | ( | QskAspect | aspect | ) |
Removes a shape hint from the local table.
QskAspect::Metric | QskAspect::Shape will be added to aspect.
aspect | Unresolved aspect |
Definition at line 548 of file QskSkinnable.cpp.
|
inline |
Removes a color hint from the local table.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
Definition at line 310 of file QskSkinnable.h.
bool QskSkinnable::resetFontRoleHint | ( | QskAspect | aspect | ) |
Removes a font role hint from the local table.
QskAspect::Flag | QskAspect::FontRole will be added to aspect.
aspect | Unresolved aspect |
Definition at line 715 of file QskSkinnable.cpp.
bool QskSkinnable::resetGraphicRoleHint | ( | QskAspect | aspect | ) |
Removes a graphic role hint from the local table.
QskAspect::Flag | QskAspect::GraphicRole will be added to aspect.
aspect | Unresolved aspect |
Definition at line 770 of file QskSkinnable.cpp.
bool QskSkinnable::resetMarginHint | ( | QskAspect | aspect | ) |
Removes a margin hint from the local table.
QskAspect::Metric | QskAspect::Margin will be added to aspect.
aspect | Unresolved aspect |
Definition at line 498 of file QskSkinnable.cpp.
|
inline |
Removes a metric hint from the local table.
QskAspect::Metric will be added to aspect.
aspect | Unresolved aspect |
Definition at line 315 of file QskSkinnable.h.
bool QskSkinnable::resetPaddingHint | ( | QskAspect | aspect | ) |
Removes a padding hint from the local table.
QskAspect::Metric | QskAspect::Padding will be added to aspect.
aspect | Unresolved aspect |
Definition at line 519 of file QskSkinnable.cpp.
bool QskSkinnable::resetPositionHint | ( | QskAspect | aspect | ) |
Definition at line 456 of file QskSkinnable.cpp.
bool QskSkinnable::resetShadowColorHint | ( | QskAspect | aspect | ) |
Definition at line 619 of file QskSkinnable.cpp.
bool QskSkinnable::resetShadowMetricsHint | ( | QskAspect | aspect | ) |
Definition at line 602 of file QskSkinnable.cpp.
bool QskSkinnable::resetSkinHint | ( | QskAspect | aspect | ) |
Remove a hint from the local hint table.
After removing the hint from the local table the hint will be resolved fro the hint table of the skin.
aspect | Unsubstituted aspect |
Definition at line 940 of file QskSkinnable.cpp.
bool QskSkinnable::resetSpacingHint | ( | QskAspect | aspect | ) |
Removes a spacing hint from the local table.
QskAspect::Metric | QskAspect::Spacing will be added to aspect.
aspect | Unresolved aspect |
Definition at line 678 of file QskSkinnable.cpp.
bool QskSkinnable::resetStippleMetricsHint | ( | QskAspect | aspect | ) |
Definition at line 661 of file QskSkinnable.cpp.
bool QskSkinnable::resetStrutSizeHint | ( | QskAspect | aspect | ) |
Removes a strut size hint from the local table.
QskAspect::Metric | QskAspect::StrutSize will be added to aspect.
aspect | Unresolved aspect |
Definition at line 477 of file QskSkinnable.cpp.
void QskSkinnable::resetSubcontrolProxy | ( | QskAspect::Subcontrol | subcontrol | ) |
Definition at line 336 of file QskSkinnable.cpp.
bool QskSkinnable::resetSymbolHint | ( | const QskAspect | aspect | ) |
Definition at line 788 of file QskSkinnable.cpp.
bool QskSkinnable::resetTextOptionsHint | ( | QskAspect | aspect | ) |
Definition at line 696 of file QskSkinnable.cpp.
const QskHintAnimator * QskSkinnable::runningHintAnimator | ( | QskAspect | aspect, |
int | index = -1 |
||
) | const |
Definition at line 1022 of file QskSkinnable.cpp.
|
virtual |
Definition at line 1562 of file QskSkinnable.cpp.
bool QskSkinnable::setAlignmentHint | ( | QskAspect | aspect, |
Qt::Alignment | alignment | ||
) |
Sets an alignment hint.
QskAspect::Flag | QskAspect::Alignment will be added to aspect.
aspect | Unresolved aspect |
alignment | Alignment hint |
Definition at line 380 of file QskSkinnable.cpp.
bool QskSkinnable::setAnimationHint | ( | QskAspect | aspect, |
QskAnimationHint | hint | ||
) |
Insert an animation hint into the local hint table
aspect | Unresolved aspect |
hint | Animation hint |
Definition at line 856 of file QskSkinnable.cpp.
bool QskSkinnable::setArcMetricsHint | ( | QskAspect | aspect, |
const QskArcMetrics & | arc | ||
) |
Definition at line 637 of file QskSkinnable.cpp.
bool QskSkinnable::setBoxBorderColorsHint | ( | QskAspect | aspect, |
const QskBoxBorderColors & | colors | ||
) |
Sets a border colors hint.
QskAspect::Color | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
border | Border colors |
Definition at line 578 of file QskSkinnable.cpp.
bool QskSkinnable::setBoxBorderMetricsHint | ( | QskAspect | aspect, |
const QskBoxBorderMetrics & | border | ||
) |
Sets a border metrics hint.
QskAspect::Metric | QskAspect::Border will be added to aspect.
aspect | Unresolved aspect |
border | Border metrics |
Definition at line 560 of file QskSkinnable.cpp.
bool QskSkinnable::setBoxShapeHint | ( | QskAspect | aspect, |
const QskBoxShapeMetrics & | shape | ||
) |
Sets a shape hint.
QskAspect::Metric | QskAspect::Shape will be added to aspect.
aspect | Unresolved aspect |
shape | Shape |
Definition at line 542 of file QskSkinnable.cpp.
bool QskSkinnable::setColor | ( | QskAspect | aspect, |
const QColor & | color | ||
) |
Sets a color hint.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
color | Color hint |
Definition at line 390 of file QskSkinnable.cpp.
bool QskSkinnable::setColor | ( | QskAspect | aspect, |
QRgb | rgb | ||
) |
Sets a color hint.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
rgb | Color hint |
Definition at line 400 of file QskSkinnable.cpp.
bool QskSkinnable::setColor | ( | QskAspect | aspect, |
Qt::GlobalColor | color | ||
) |
Sets a color hint.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
color | Color hint |
Definition at line 395 of file QskSkinnable.cpp.
bool QskSkinnable::setFlagHint | ( | QskAspect | aspect, |
int | flag | ||
) |
Sets a flag hint.
aspect | Unresolved aspect |
flag | Flag hint |
Definition at line 375 of file QskSkinnable.cpp.
bool QskSkinnable::setFontRoleHint | ( | QskAspect | aspect, |
const QskFontRole & | role | ||
) |
Sets a font role hint.
QskAspect::Flag | QskAspect::FontRole will be added to aspect.
aspect | Unresolved aspect |
role | Font role |
Definition at line 708 of file QskSkinnable.cpp.
bool QskSkinnable::setGradientHint | ( | QskAspect | aspect, |
const QskGradient & | gradient | ||
) |
Sets a gradient as color hint.
QskAspect::Color will be added to aspect.
aspect | Unresolved aspect |
gradient | Gradint |
Definition at line 530 of file QskSkinnable.cpp.
bool QskSkinnable::setGraphicRoleHint | ( | QskAspect | aspect, |
int | role | ||
) |
Sets a graphic role hint.
QskAspect::Flag | QskAspect::GraphicRole will be added to aspect.
aspect | Unresolved aspect |
role | Graphic role |
Definition at line 765 of file QskSkinnable.cpp.
bool QskSkinnable::setMarginHint | ( | QskAspect | aspect, |
const QMarginsF & | margins | ||
) |
Sets a margin hint.
QskAspect::Metric | QskAspect::Margin will be added to aspect.
aspect | Unresolved aspect |
margin | Margin |
Definition at line 493 of file QskSkinnable.cpp.
bool QskSkinnable::setMarginHint | ( | QskAspect | aspect, |
qreal | margins | ||
) |
Sets a margin hint.
QskAspect::Metric | QskAspect::Margin will be added to aspect.
aspect | Unresolved aspect |
margin | Margin |
Definition at line 488 of file QskSkinnable.cpp.
bool QskSkinnable::setMetric | ( | QskAspect | aspect, |
qreal | metric | ||
) |
Sets a metric hint.
QskAspect::Metric will be added to aspect.
aspect | Unresolved aspect |
metric | Metric hint |
Definition at line 425 of file QskSkinnable.cpp.
bool QskSkinnable::setPaddingHint | ( | QskAspect | aspect, |
const QMarginsF & | padding | ||
) |
Sets a padding hint.
QskAspect::Metric | QskAspect::Padding will be added to aspect.
aspect | Unresolved aspect |
padding | Padding |
Definition at line 514 of file QskSkinnable.cpp.
bool QskSkinnable::setPaddingHint | ( | QskAspect | aspect, |
qreal | padding | ||
) |
Sets a padding hint.
QskAspect::Metric | QskAspect::Padding will be added to aspect.
aspect | Unresolved aspect |
padding | Padding |
Definition at line 509 of file QskSkinnable.cpp.
bool QskSkinnable::setPositionHint | ( | QskAspect | aspect, |
qreal | position | ||
) |
Definition at line 440 of file QskSkinnable.cpp.
bool QskSkinnable::setShadowColorHint | ( | QskAspect | aspect, |
const QColor & | color | ||
) |
Definition at line 614 of file QskSkinnable.cpp.
bool QskSkinnable::setShadowMetricsHint | ( | QskAspect | aspect, |
const QskShadowMetrics & | metrics | ||
) |
Definition at line 596 of file QskSkinnable.cpp.
bool QskSkinnable::setSkinHint | ( | QskAspect | aspect, |
const QVariant & | hint | ||
) |
Insert a hint into the local hint table.
Presentation, beheviour and layout of the scene graph nodes are affected by specific attributes - skin hints - that are configured in a table of the skin. Each skinnable has its own table where these attributes can be overloaded. Hints from the local table have precedence over those from the skin.
The subControl bits of the aspect might be substituted, depending on the implementation of effectiveSubcontrol(). By inserting the hint directly into the hintTable() the substitution can be avoided.
aspect | Unsubstituted aspect |
hint | Hint, might be anything that fits into a QVariant and is understood by the skinlet consuming it. |
Definition at line 927 of file QskSkinnable.cpp.
void QskSkinnable::setSkinlet | ( | const QskSkinlet * | skinlet | ) |
Set an individual skinlet to render/display the content.
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.
When QskSkinlet::isOwnedBySkinnable() is true, the skinlet will be deleted, when the skinnable is deleted or a different skinlet gets assigned.
skinlet | Skinlet to render/layout the skinnable. |
Definition at line 272 of file QskSkinnable.cpp.
void QskSkinnable::setSkinStateFlag | ( | QskAspect::State | stateFlag, |
bool | on = true |
||
) |
Set/Clear a state in the state bits
stateFlag | State bit |
on | true or false |
Definition at line 1378 of file QskSkinnable.cpp.
void QskSkinnable::setSkinStates | ( | QskAspect::States | newStates | ) |
Definition at line 1413 of file QskSkinnable.cpp.
bool QskSkinnable::setSpacingHint | ( | QskAspect | aspect, |
qreal | spacing | ||
) |
Sets a spacing hint.
QskAspect::Metric | QskAspect::Spacing will be added to aspect.
aspect | Unresolved aspect |
spacing | Spacing |
Definition at line 673 of file QskSkinnable.cpp.
bool QskSkinnable::setStippleMetricsHint | ( | QskAspect | aspect, |
const QskStippleMetrics & | metrics | ||
) |
Definition at line 655 of file QskSkinnable.cpp.
bool QskSkinnable::setStrutSizeHint | ( | QskAspect | aspect, |
const QSizeF & | size | ||
) |
Sets a metric hint.
QskAspect::Metric | QskAspect::StrutSize will be added to aspect.
aspect | Unresolved aspect |
size | Strut size hint |
Definition at line 472 of file QskSkinnable.cpp.
bool QskSkinnable::setStrutSizeHint | ( | QskAspect | aspect, |
qreal | width, | ||
qreal | height | ||
) |
Sets a strut size hint.
QskAspect::Metric | QskAspect::StrutSize will be added to aspect.
aspect | Unresolved aspect |
width | Width of the strut size |
height | Height of the strut size |
Definition at line 466 of file QskSkinnable.cpp.
void QskSkinnable::setSubcontrolProxy | ( | QskAspect::Subcontrol | subControl, |
QskAspect::Subcontrol | proxy | ||
) |
Definition at line 318 of file QskSkinnable.cpp.
bool QskSkinnable::setSymbolHint | ( | const QskAspect | aspect, |
const QskGraphic & | symbol | ||
) |
Definition at line 781 of file QskSkinnable.cpp.
bool QskSkinnable::setTextOptionsHint | ( | QskAspect | aspect, |
const QskTextOptions & | options | ||
) |
Definition at line 689 of file QskSkinnable.cpp.
QColor QskSkinnable::shadowColorHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 624 of file QskSkinnable.cpp.
QskShadowMetrics QskSkinnable::shadowMetricsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 607 of file QskSkinnable.cpp.
const QskSkinlet * QskSkinnable::skinlet | ( | ) | const |
Definition at line 302 of file QskSkinnable.cpp.
QskAspect::States QskSkinnable::skinStates | ( | ) | const |
Definition at line 1192 of file QskSkinnable.cpp.
const char * QskSkinnable::skinStatesAsPrintable | ( | ) | const |
Definition at line 1197 of file QskSkinnable.cpp.
const char * QskSkinnable::skinStatesAsPrintable | ( | QskAspect::States | states | ) | const |
Definition at line 1202 of file QskSkinnable.cpp.
qreal QskSkinnable::spacingHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a spacing hint.
QskAspect::Metric | QskAspect::Spacing will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 683 of file QskSkinnable.cpp.
bool QskSkinnable::startHintTransitions | ( | const QVector< QskAspect::Subcontrol > & | subControls, |
QskAspect::States | oldStates, | ||
QskAspect::States | newStates, | ||
int | index = -1 |
||
) |
Definition at line 1462 of file QskSkinnable.cpp.
bool QskSkinnable::startHintTransitions | ( | QskAspect::States | oldStates, |
QskAspect::States | newStates, | ||
int | index = -1 |
||
) |
Definition at line 1451 of file QskSkinnable.cpp.
void QskSkinnable::startTransition | ( | QskAspect | aspect, |
int | index, | ||
QskAnimationHint | animationHint, | ||
const QVariant & | from, | ||
const QVariant & | to | ||
) |
Definition at line 1333 of file QskSkinnable.cpp.
void QskSkinnable::startTransition | ( | QskAspect | aspect, |
QskAnimationHint | animationHint, | ||
const QVariant & | from, | ||
const QVariant & | to | ||
) |
Definition at line 1327 of file QskSkinnable.cpp.
QskStippleMetrics QskSkinnable::stippleMetricsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 666 of file QskSkinnable.cpp.
QSizeF QskSkinnable::strutSizeHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Retrieves a strut size hint.
QskAspect::Metric | QskAspect::StrutSize will be added to aspect.
aspect | Unresolved aspect |
status | Optional status information |
Definition at line 482 of file QskSkinnable.cpp.
QRectF QskSkinnable::subControlContentsRect | ( | const QRectF & | contentsRect, |
QskAspect::Subcontrol | subControl | ||
) | const |
Calculate the inner rectangle for 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.
contentsRect | Bounding rectangle for laying out the nodes of the skinnable |
subControl | Unsubstituted subcontrol |
Definition at line 1300 of file QskSkinnable.cpp.
QskAspect::Subcontrol QskSkinnable::subcontrolProxy | ( | QskAspect::Subcontrol | subControl | ) | const |
Definition at line 353 of file QskSkinnable.cpp.
QRectF QskSkinnable::subControlRect | ( | const QRectF & | contentsRect, |
QskAspect::Subcontrol | subControl | ||
) | const |
Calculate position and size of a subControl.
A convenience method that forwards the calculation to the skinlet
contentsRect | Bounding rectangle for laying out the nodes of the skinnable |
subControl | Unsubstituted subcontrol |
Definition at line 1294 of file QskSkinnable.cpp.
|
protectedvirtual |
Definition at line 1585 of file QskSkinnable.cpp.
QskGraphic QskSkinnable::symbolHint | ( | const QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 793 of file QskSkinnable.cpp.
QskTextOptions QskSkinnable::textOptionsHint | ( | QskAspect | aspect, |
QskSkinHintStatus * | status = nullptr |
||
) | const |
Definition at line 701 of file QskSkinnable.cpp.
|
protectedvirtual |
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.
The default implementation simply forwards the operation to the skinlet,
parentNode | The parent of the nodes to be added in this method. |
Reimplemented in QskDrawer, QskMenu, and QskTextInput.
Definition at line 1567 of file QskSkinnable.cpp.