Skip to content

Commit

Permalink
fix Qt 6 font weight
Browse files Browse the repository at this point in the history
Qt 6 removed a setWeight() that takes int and the QFont::Weight enum
values are all multiples of 100.
  • Loading branch information
ddennedy committed May 12, 2023
1 parent c352b79 commit 7cffaad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/qt/filter_qtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ static QRectF get_text_path(QPainterPath *qpath,
QFont font;
font.setPixelSize(mlt_properties_get_int(filter_properties, "size") * scale);
font.setFamily(mlt_properties_get(filter_properties, "family"));
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
font.setWeight(QFont::Weight((mlt_properties_get_int(filter_properties, "weight") / 10) - 1));
#else
font.setWeight(QFont::Weight(mlt_properties_get_int(filter_properties, "weight")));
#endif
switch (style) {
case 'i':
case 'I':
Expand Down

0 comments on commit 7cffaad

Please sign in to comment.