From 6692462dcb0e1fa23888e96bff4137f03cc935f9 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 5 Jun 2024 11:46:45 +0200 Subject: [PATCH] Wizard: Fix size calculation of outline titles On macOS we now (with Qt 6.7) get nice, high resolution pixmaps from QIcon::fromTheme. That means that our wrong assumption that the pixmap size == UI size leads to huge layout sizes for the indicator of the current wizard page. We need to take devicePixelRatio into account for determining the UI size. Fixes: QTCREATORBUG-31015 Change-Id: I6e9c77cf2f37fce60735e75c1fa694e4b4208b98 Reviewed-by: Marcus Tillmanns --- src/libs/utils/wizard.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/wizard.cpp b/src/libs/utils/wizard.cpp index 71069e60f66..29bfb787a6a 100644 --- a/src/libs/utils/wizard.cpp +++ b/src/libs/utils/wizard.cpp @@ -45,7 +45,9 @@ public: m_indicatorPixmap(indicatorPixmap) { m_indicatorLabel = new QLabel(this); - m_indicatorLabel->setFixedSize(m_indicatorPixmap.size()); + const QSizeF indicatorSize = m_indicatorPixmap.deviceIndependentSize(); + m_indicatorLabel->setFixedSize( + {qCeil(indicatorSize.width()), qCeil(indicatorSize.height())}); m_titleLabel = new QLabel(title, this); auto l = new QHBoxLayout(this); l->setContentsMargins(0, 0, 0, 0);