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 <alessandro.portale@digia.com>
This commit is contained in:
Alessandro Portale
2014-07-08 10:02:12 +02:00
parent 0016e385ab
commit 4ee38b2925

View File

@@ -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