From 229f931d6e0227108e44d85586c88c562500eb12 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 12 Jul 2013 14:45:25 +0200 Subject: Add support for baseline alignment This is a prerequisite for baseline support in Qt Quick Layouts Change-Id: I1f032106cd1e7248a7688b6b9ca59f062a596d49 Reviewed-by: Konstantin Ritt Reviewed-by: J-P Nurmi --- src/corelib/global/qnamespace.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/corelib/global/qnamespace.h') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 81329fd5ba..836d4a92ed 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -223,7 +223,7 @@ public: // Text formatting flags for QPainter::drawText and QLabel. // The following two enums can be combined to one integer which - // is passed as 'flags' to drawText and qt_format_text. + // is passed as 'flags' to QPainter::drawText, QFontMetrics::boundingRect and qt_format_text. enum AlignmentFlag { AlignLeft = 0x0001, @@ -238,7 +238,12 @@ public: AlignTop = 0x0020, AlignBottom = 0x0040, AlignVCenter = 0x0080, - AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter, + AlignBaseline = 0x0100, + // Note that 0x100 will clash with Qt::TextSingleLine = 0x100 due to what the comment above + // this enum declaration states. However, since Qt::AlignBaseline is only used by layouts, + // it doesn't make sense to pass Qt::AlignBaseline to QPainter::drawText(), so there + // shouldn't really be any ambiguity between the two overlapping enum values. + AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter | AlignBaseline, AlignCenter = AlignVCenter | AlignHCenter }; -- cgit v1.2.3