diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 16:05:43 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-25 16:07:22 +0200 |
commit | 122a3bcc3fb8a48e175226ad7681b1c27c37b70d (patch) | |
tree | 76b6f27e08b678de3a4716af19e50d764f7e15c4 | |
parent | a490f7f061f0af7f642de0e230381a454db7f785 (diff) |
widget: Add typecasts to remaining QFont pixel size scaling code
-rw-r--r-- | src/widget/wlabel.cpp | 3 | ||||
-rw-r--r-- | src/widget/wwidget.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/widget/wlabel.cpp b/src/widget/wlabel.cpp index 48404061b2..5a07154bc5 100644 --- a/src/widget/wlabel.cpp +++ b/src/widget/wlabel.cpp @@ -132,7 +132,8 @@ bool WLabel::event(QEvent* pEvent) { // resetting the font to the original css values. // Only scale pixel size fonts, point size fonts are scaled by the OS if (fonti.pixelSize() > 0) { - const_cast<QFont&>(fonti).setPixelSize(fonti.pixelSize() * m_scaleFactor); + const_cast<QFont&>(fonti).setPixelSize( + static_cast<int>(fonti.pixelSize() * m_scaleFactor)); } // measure text with the new font setText(m_longText); diff --git a/src/widget/wwidget.cpp b/src/widget/wwidget.cpp index 364b46280a..4f05531072 100644 --- a/src/widget/wwidget.cpp +++ b/src/widget/wwidget.cpp @@ -51,7 +51,8 @@ bool WWidget::event(QEvent* e) { // resetting the font to the original css values. // Only scale pixel size fonts, point size fonts are scaled by the OS if (fonti.pixelSize() > 0) { - const_cast<QFont&>(fonti).setPixelSize(fonti.pixelSize() * m_scaleFactor); + const_cast<QFont&>(fonti).setPixelSize( + static_cast<int>(fonti.pixelSize() * m_scaleFactor)); } } else if (isEnabled()) { switch(e->type()) { |