Commit 992cf79c authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

[Qt6] Fix QFont::Weight enum

parent 471508bd
......@@ -463,7 +463,7 @@ int TitleDocument::loadFromXml(const QDomDocument &doc, QList<QGraphicsItem *> &
font.setBold(node.nodeValue().toInt() != 0);
} else {
// New: Font weight (QFont::)
font.setWeight(txtProperties.namedItem(QStringLiteral("font-weight")).nodeValue().toInt());
font.setWeight(QFont::Weight(txtProperties.namedItem(QStringLiteral("font-weight")).nodeValue().toInt()));
}
// font.setBold(txtProperties.namedItem("font-bold").nodeValue().toInt());
font.setItalic(txtProperties.namedItem(QStringLiteral("font-italic")).nodeValue().toInt() != 0);
......
......@@ -1078,7 +1078,7 @@ void TitleWidget::slotNewText(MyTextItem *tt)
QFont font = font_family->currentFont();
font.setPixelSize(font_size->value());
// mbd: issue 551:
font.setWeight(font_weight_box->itemData(font_weight_box->currentIndex()).toInt());
font.setWeight(QFont::Weight(font_weight_box->itemData(font_weight_box->currentIndex()).toInt()));
font.setItalic(buttonItalic->isChecked());
font.setUnderline(buttonUnder->isChecked());
......@@ -1777,7 +1777,7 @@ void TitleWidget::slotUpdateText()
font.setPixelSize(font_size->value());
font.setItalic(buttonItalic->isChecked());
font.setUnderline(buttonUnder->isChecked());
font.setWeight(font_weight_box->itemData(font_weight_box->currentIndex()).toInt());
font.setWeight(QFont::Weight(font_weight_box->itemData(font_weight_box->currentIndex()).toInt()));
if (letter_spacing->value() != 0) {
font.setLetterSpacing(QFont::AbsoluteSpacing, letter_spacing->value());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment