qt6-bb10/tests/auto/gui
Eskil Abrahamsen Blomfeldt 583a81cc1c Don't include bearing of mid-string characters in max width
When calculating the maximum width of a text layout, we
would add the text width of each substring *after* we had
added the negative right bearing of the last character to it.
But the bearing of the last character in a wrapped substring
does not actually add to the maximum width unless it is the
last character of the *whole* string.

Prior to 250117086ff15bba79df8f0e15ee66192edc9ea9 this was
not noticed, because the last glyph in the substring would
typically be a space and the space does not have any
bearings (when doing wrapping on individual characters it
could still happen). After the change, the previous glyph
for which we get the right bearing will be the last
non-whitespace glyph. If this happened to have a negative
right bearing, we would add this to the max width and
end up with a larger max width than we should.

This caused a test failure in tst_qquicktext.

This test prefers the text width without the bearing (i.e.
the *advance* of the substring) unless the line is manually
wrapped or it is the last line of the layout.

Change-Id: Iba1a5ad48d575683672400f0572dfa683a0f2d9c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit c08a92307d6d9fa9d9d9a1f301e3f2a65374e99a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 610ee0c5040cac4989a1f624e7678f83668e99a0)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-01-16 11:57:47 +01:00
..
image tst_QImage: fix discarded QFile::open() results 2025-01-01 04:02:36 +00:00
itemmodels QStandardItem: correctly set model during insertRows() 2025-01-15 00:10:00 +00:00
kernel QThread/Unix: revert to pthread destruction instead of thread_local 2025-01-14 02:21:01 -03:00
math3d tst_qmatrixnxn: Mark variable as unused to avoid compiler warning 2024-05-29 20:27:18 +02:00
painting Fix QTransform::quadToQuad() to work with QRectF 2025-01-03 05:52:46 +00:00
platform Tests: Reduce the number of module includes 2024-11-04 19:42:27 +00:00
qopengl Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglconfig Change license for tests files 2024-02-04 09:56:42 +01:00
qvulkan Vulkan test: replace QVERIFY with appropriate QCOMPARE 2024-09-23 19:36:54 +00:00
rhi Revert "Skip Vulkan on Android in QRhi autotest" 2024-04-05 20:31:07 +00:00
text Don't include bearing of mid-string characters in max width 2025-01-16 11:57:47 +01:00
util QDesktopServices: clean up pre-Qt-6.6 code 2024-05-15 18:22:39 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00