diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-07-12 14:45:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 11:58:44 +0200 |
commit | 229f931d6e0227108e44d85586c88c562500eb12 (patch) | |
tree | 269685e269f84bebcd85a80d01cd5d2b5dcb3d15 /src | |
parent | e24f75af4db89ebdfd3d48e9d007238a1b990cd2 (diff) |
Add support for baseline alignment
This is a prerequisite for baseline support in Qt Quick Layouts
Change-Id: I1f032106cd1e7248a7688b6b9ca59f062a596d49
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 9 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 1 |
2 files changed, 8 insertions, 2 deletions
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 }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 03ac8c6153..c1dde19a2e 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -67,6 +67,7 @@ \value AlignTop Aligns with the top. \value AlignBottom Aligns with the bottom. \value AlignVCenter Centers vertically in the available space. + \value AlignBaseline Aligns with the baseline. You can use only one of the horizontal flags at a time. There is one two-dimensional flag: |