graphicRole property added

This commit is contained in:
Uwe Rathmann 2021-01-07 13:49:57 +01:00
parent f037297620
commit e7d03e2ddd
2 changed files with 25 additions and 1 deletions

View File

@ -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

View File

@ -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;