forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user