diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-02 08:06:44 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-02 08:19:40 (GMT) |
commit | ac9e63b58533a3215106ed9da82cff3a3e3dda3a (patch) | |
tree | 5d9cda589cb4018ce825b6eba5673ffba35529be /src | |
parent | 49d2906a9566c8b44df48f51ca137b9ba2feb671 (diff) | |
download | Qt-ac9e63b58533a3215106ed9da82cff3a3e3dda3a.zip Qt-ac9e63b58533a3215106ed9da82cff3a3e3dda3a.tar.gz Qt-ac9e63b58533a3215106ed9da82cff3a3e3dda3a.tar.bz2 |
Make pixel size a qreal in QRawFont
The pixel size in the font engines is already a floating point value.
For maximum flexibility, we should expose this in the public API.
Task-number: QTBUG-18817
Reviewed-by: Jiang Jiang
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qrawfont.cpp | 6 | ||||
-rw-r--r-- | src/gui/text/qrawfont.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 6ac2677..1bce909 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -308,10 +308,10 @@ qreal QRawFont::descent() const \sa setPixelSize() */ -int QRawFont::pixelSize() const +qreal QRawFont::pixelSize() const { if (!isValid()) - return -1; + return 0.0; return d->fontEngine->fontDef.pixelSize; } @@ -577,7 +577,7 @@ QRawFont QRawFont::fromFont(const QFont &font, QFontDatabase::WritingSystem writ /*! Sets the pixel size with which this font should be rendered to \a pixelSize. */ -void QRawFont::setPixelSize(int pixelSize) +void QRawFont::setPixelSize(qreal pixelSize) { if (d->fontEngine == 0) return; diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h index 96dc838..56aeefc 100644 --- a/src/gui/text/qrawfont.h +++ b/src/gui/text/qrawfont.h @@ -96,8 +96,8 @@ public: const QTransform &transform = QTransform()) const; QPainterPath pathForGlyph(quint32 glyphIndex) const; - void setPixelSize(int pixelSize); - int pixelSize() const; + void setPixelSize(qreal pixelSize); + qreal pixelSize() const; QFont::HintingPreference hintingPreference() const; |