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:
Uwe Rathmann 2024-02-09 09:11:41 +01:00
parent d7a7dc5c47
commit 49dda7ec04

View File

@ -722,7 +722,18 @@ int QskSkinnable::fontRoleHint(
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