forked from qt-creator/qt-creator
QmlDesigner: Fix Qt6 build
Add more QFont::Weight workarounds. The functions have to be refactored in the future. Change-Id: I5658a725c6c891d65f374484147d7cb5ae150980 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -145,7 +145,11 @@ std::pair<QImage, QImage> ImageCacheFontCollector::createImage(
|
||||
QFont font(fontFamily);
|
||||
font.setStyle(rawFont.style());
|
||||
font.setStyleName(rawFont.styleName());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
font.setWeight(QFont::Weight(rawFont.weight()));
|
||||
#else
|
||||
font.setWeight(rawFont.weight());
|
||||
#endif
|
||||
QImage image(size, QImage::Format_ARGB32);
|
||||
image.fill(Qt::transparent);
|
||||
int pixelSize(200);
|
||||
@@ -207,7 +211,11 @@ QIcon ImageCacheFontCollector::createIcon(Utils::SmallStringView name,
|
||||
QFont font(fontFamily);
|
||||
font.setStyle(rawFont.style());
|
||||
font.setStyleName(rawFont.styleName());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
font.setWeight(QFont::Weight(rawFont.weight()));
|
||||
#else
|
||||
font.setWeight(rawFont.weight());
|
||||
#endif
|
||||
for (QSize size : sizes) {
|
||||
QPixmap pixmap(size);
|
||||
pixmap.fill(Qt::transparent);
|
||||
|
Reference in New Issue
Block a user