Qt5 incompatibility fixed

This commit is contained in:
Uwe Rathmann 2024-02-20 13:31:53 +01:00
parent bb3f453c7b
commit 8fd8034d2a

View File

@ -344,8 +344,15 @@ void QskSkin::completeFontTable()
continue; continue;
} }
int weight = normalFont.weight() + ( j - 2 ) * 100; #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
weight = qBound( 0, weight, 900 ); const auto step = 10; // weight: [0-99]
#else
const auto step = 100; // weight: [1-1000]
#endif
int weight = normalFont.weight() + ( j - 2 ) * step;
weight = qBound( static_cast<int>( QFont::Thin ),
weight, static_cast<int>( QFont::Black ) );
auto font = normalFont; auto font = normalFont;
font.setWeight( static_cast< QFont::Weight >( weight ) ); font.setWeight( static_cast< QFont::Weight >( weight ) );