diff --git a/src/controls/QskStatusIndicator.cpp b/src/controls/QskStatusIndicator.cpp index fb364b64..f2b7c99f 100644 --- a/src/controls/QskStatusIndicator.cpp +++ b/src/controls/QskStatusIndicator.cpp @@ -157,7 +157,24 @@ void QskStatusIndicator::setGraphic( int status, const QskGraphic& graphic ) QskColorFilter QskStatusIndicator::graphicFilter( int status ) const { Q_UNUSED( status ) - return effectiveGraphicFilter( QskStatusIndicator::Graphic ); + return effectiveGraphicFilter( Graphic ); +} + +void QskStatusIndicator::setGraphicRole( int role ) +{ + if ( setGraphicRoleHint( Graphic, role ) ) + Q_EMIT graphicRoleChanged( role ); +} + +void QskStatusIndicator::resetGraphicRole() +{ + if ( resetGraphicRoleHint( Graphic ) ) + Q_EMIT graphicRoleChanged( graphicRoleHint( Graphic ) ); +} + +int QskStatusIndicator::graphicRole() const +{ + return graphicRoleHint( Graphic ); } int QskStatusIndicator::status() const diff --git a/src/controls/QskStatusIndicator.h b/src/controls/QskStatusIndicator.h index 84fd6203..98314b2b 100644 --- a/src/controls/QskStatusIndicator.h +++ b/src/controls/QskStatusIndicator.h @@ -17,6 +17,8 @@ class QSK_EXPORT QskStatusIndicator : public QskControl Q_OBJECT Q_PROPERTY( int status READ status() WRITE setStatus NOTIFY statusChanged ) + Q_PROPERTY( int graphicRole READ graphicRole + WRITE setGraphicRole RESET resetGraphicRole NOTIFY graphicRoleChanged ) using Inherited = QskControl; @@ -32,6 +34,10 @@ class QSK_EXPORT QskStatusIndicator : public QskControl QskGraphic graphic( int status ) const; void setGraphic( int status, const QskGraphic& ); + void setGraphicRole( int role ); + void resetGraphicRole(); + int graphicRole() const; + virtual QskColorFilter graphicFilter( int status ) const; virtual QskGraphic loadSource( const QUrl& ) const; @@ -45,6 +51,7 @@ class QSK_EXPORT QskStatusIndicator : public QskControl Q_SIGNALS: void statusChanged( int status ); + void graphicRoleChanged( int ); protected: void changeEvent( QEvent* ) override;