API reference
TextPaintCompat
Public types, functions, and constants declared in this header.
No matching API members.
fluent::painting
Methods
inline qreal verticallyCenteredTextBaseline(const QRectF& targetRect, const QFontMetricsF& metrics)Returns a centered font baseline, independent of the displayed characters.
inline int verticallyCenteredTextBaseline(const QRect& targetRect, const QFontMetrics& metrics)Preserves Qt's integer geometry rounding for existing point-based text painters.
inline int devicePixelRatioMetric(QPaintDevice::PaintDeviceMetric metric, qreal dpr)Encodes a target DPR for a forwarding paint device's metric override.
inline qreal imageRasterDpr(qreal dpr)Returns the DPR precision used by QImage's raster paint device.
inline qreal verticallyCenteredTextInkOffset(const QRectF& targetRect, const QFontMetricsF& metrics, const QString& text)Returns the vertical translation that centers visible glyph ink in a target rectangle.
inline QRectF verticallyCenteredTextInkRect(const QRectF& targetRect, const QFontMetricsF& metrics, const QString& text)Returns a text rectangle translated so its visible glyph ink is vertically centered.
inline QRectF verticallyCenteredTextInkRect(const QRectF& targetRect, const QPainter& painter, const QString& text)Centers shaped glyph ink, including text that combines fallback fonts.
inline qreal alignedTextInkCenterY(const QRectF& alignedRect, const QFontMetricsF& metrics, const QString& text)Returns the visible glyph-ink center for text drawn with vertical-center alignment.
inline void drawVerticallyCenteredText(QPainter& painter, const QRectF& targetRect, const QString& text, Qt::Alignment horizontalAlignment = Qt::AlignLeft)Draws control text centered on the font line box, so labels in a row share one baseline.