QskSkinnable::effectiveFont accepts QFont ( beside font roles ). This
allows to assign individual fonts in application code without having to define font roles
This commit is contained in:
parent
d7a7dc5c47
commit
49dda7ec04
|
@ -722,7 +722,18 @@ int QskSkinnable::fontRoleHint(
|
||||||
|
|
||||||
QFont QskSkinnable::effectiveFont( const QskAspect aspect ) const
|
QFont QskSkinnable::effectiveFont( const QskAspect aspect ) const
|
||||||
{
|
{
|
||||||
return effectiveSkin()->font( fontRoleHint( aspect ) );
|
const auto hint = effectiveSkinHint( aspect | QskAspect::FontRole );
|
||||||
|
if ( hint.canConvert< QFont >() )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
The provided skins/controls use font roles only - however
|
||||||
|
application code might want to assign fonts without defining
|
||||||
|
font roles.
|
||||||
|
*/
|
||||||
|
return hint.value< QFont >();
|
||||||
|
}
|
||||||
|
|
||||||
|
return effectiveSkin()->font( hint.toInt() ); // font role
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskSkinnable::effectiveFontHeight( const QskAspect aspect ) const
|
qreal QskSkinnable::effectiveFontHeight( const QskAspect aspect ) const
|
||||||
|
|
Loading…
Reference in New Issue