diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-26 12:36:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-10-01 15:30:43 +0200 |
commit | 0175ad4d3ff3de93645b4a8b300ef3b7d6e15c04 (patch) | |
tree | 717da251e067cf98c52c410c644fe77d989fd2f1 /src/gui/painting | |
parent | f5f300ba820f8e6a268790e76d5cdb084853a099 (diff) |
Fix regression in metric calculation of text with mnemonics
Even when we do not intend to display the text, we still need to go
through the processing of mnemonics to remove them from the text.
Instead of capping the max underlines to 0, the TextDontPrint option now
just saves adding the underline formats.
Task-number: QTBUG-41593
Change-Id: I67790650dbed0092de2c63e5d5a9349dc02d5846
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 4a2898375e..40f2d10abb 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7442,10 +7442,6 @@ start_lengthVariant: } } - // no need to do extra work for underlines if we don't paint - if (tf & Qt::TextDontPrint) - maxUnderlines = 0; - QList<QTextLayout::FormatRange> underlineFormats; int length = offset - old_offset; if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) { @@ -7460,7 +7456,7 @@ start_lengthVariant: --l; if (!l) break; - if (*cin != QLatin1Char('&') && !hidemnmemonic) { + if (*cin != QLatin1Char('&') && !hidemnmemonic && !(tf & Qt::TextDontPrint)) { QTextLayout::FormatRange range; range.start = cout - cout0; range.length = 1; |