Skip to content

Commit

Permalink
Fix/avoid some Clazy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cbjeukendrup committed Feb 28, 2025
1 parent 8608788 commit 6d53b9c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/framework/ui/api/themeapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void ThemeApi::initMusicalFont()

void ThemeApi::setupUiFonts()
{
QMap<QFont*, FontConfig> fonts {
const std::vector<std::pair<QFont*, FontConfig> > fonts {
{ &m_bodyFont, { QFont::Normal, FontSizeType::BODY } },
{ &m_bodyBoldFont, { QFont::DemiBold, FontSizeType::BODY } },
{ &m_largeBodyFont, { QFont::Normal, FontSizeType::BODY_LARGE } },
Expand All @@ -393,14 +393,13 @@ void ThemeApi::setupUiFonts()
{ &m_titleBoldFont, { QFont::DemiBold, FontSizeType::TITLE } },
};

for (QFont* font : fonts.keys()) {
for (const auto& [font, fontConfig] : fonts) {
std::string family = configuration()->fontFamily();
int size = configuration()->fontSize(fonts[font].sizeType);
QFont::Weight weight = fonts[font].weight;
int size = configuration()->fontSize(fontConfig.sizeType);

font->setPixelSize(size);
font->setFamily(QString::fromStdString(family));
font->setWeight(weight);
font->setWeight(fontConfig.weight);
}

m_defaultFont.setFamily(QString::fromStdString(configuration()->defaultFontFamily()));
Expand Down Expand Up @@ -626,7 +625,7 @@ void ProxyStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOpt

// GroupBox
case QStyle::PE_FrameGroupBox: {
drawRoundedRect(painter, option->rect, DEFAULT_RADIUS, QBrush("#03000000"),
drawRoundedRect(painter, option->rect, DEFAULT_RADIUS, QBrush(0x03000000),
QPen(m_theme->strokeColor(), fmax(m_theme->borderWidth(), 1.0)));
} break;

Expand Down

0 comments on commit 6d53b9c

Please sign in to comment.