From 4ee38b29258f5cec25c7d94ae2690fcdac312fd4 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 8 Jul 2014 10:02:12 +0200 Subject: [PATCH] Core: Fix "compile error" overlay in progressmanager_win In order to fit a text into a fixed-sized image, we have to use pixel sizes for fonts. The default point size can be anything and the dpi can be anything. Also, decomplicate the drawText call. Change-Id: I20da8177a8a261c6ffbaef27060d804d924e1259 Reviewed-by: Alessandro Portale --- .../coreplugin/progressmanager/progressmanager_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp index ac21a46b54c..ef9935cba1e 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp @@ -126,9 +126,9 @@ void Core::Internal::ProgressManagerPrivate::doSetApplicationLabel(const QString QPainter p(&pix); p.setPen(Qt::white); QFont font = p.font(); - font.setPointSize(font.pointSize()-2); + font.setPixelSize(pix.height() * 0.5); p.setFont(font); - p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text); + p.drawText(pix.rect(), Qt::AlignCenter, text); #if QT_VERSION >= 0x050000 const HICON icon = qt_pixmapToWinHICON(pix); #else