<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/src/quick/util/qquickstyledtext.cpp, branch dev</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>QQuickStyledText: simplify lookupHtmlTag</title>
<updated>2026-06-01T10:37:28+00:00</updated>
<author>
<name>Vladimir Belyavsky</name>
<email>belyavskyv@gmail.com</email>
</author>
<published>2026-05-28T21:10:52+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=3b74ad8a06b50635fe9517e25426da7cf7db0fcb'/>
<id>3b74ad8a06b50635fe9517e25426da7cf7db0fcb</id>
<content type='text'>
QTextHtmlParser::lookupElement now compares elements case
insensitively, so there is no need to manually lower-case
the input tag before the lookup.

Remove the QVarLengthArray and the per-character toLower loop.

Change-Id: Ie0b960b5385c3fd43251795e0f8e4a7eb87e01b8
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
QTextHtmlParser::lookupElement now compares elements case
insensitively, so there is no need to manually lower-case
the input tag before the lookup.

Remove the QVarLengthArray and the per-character toLower loop.

Change-Id: Ie0b960b5385c3fd43251795e0f8e4a7eb87e01b8
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQuickStyledText: use QTextHtmlParser::lookupElement() for tag dispatch</title>
<updated>2026-05-28T20:22:30+00:00</updated>
<author>
<name>Vladimir Belyavsky</name>
<email>belyavskyv@gmail.com</email>
</author>
<published>2026-05-22T13:16:19+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=fc9b1edb3bbda0646440dfc1ecc3a79bf34bda6f'/>
<id>fc9b1edb3bbda0646440dfc1ecc3a79bf34bda6f</id>
<content type='text'>
Replace hand-written if/else chains comparing tag characters with
switch statements over QTextHtmlParser::lookupElement(). This reuses
the shared HTML element lookup table from QtGui instead of duplicating
tag name matching logic.

The result is more readable, easier to maintain, and ensures that tag
identification stays consistent with the rest of Qt's HTML handling.

Change-Id: I49421b99e09157d7e12142a5192831acafffed29
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace hand-written if/else chains comparing tag characters with
switch statements over QTextHtmlParser::lookupElement(). This reuses
the shared HTML element lookup table from QtGui instead of duplicating
tag name matching logic.

The result is more readable, easier to maintain, and ensures that tag
identification stays consistent with the rest of Qt's HTML handling.

Change-Id: I49421b99e09157d7e12142a5192831acafffed29
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQuickText: use ObjectReplacementCharacter for inline images</title>
<updated>2026-05-27T16:42:59+00:00</updated>
<author>
<name>Vladimir Belyavsky</name>
<email>belyavskyv@gmail.com</email>
</author>
<published>2026-04-03T19:01:12+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=526e2985f2fa52812381a4620ea9e4d4c6a44025'/>
<id>526e2985f2fa52812381a4620ea9e4d4c6a44025</id>
<content type='text'>
Replace the Nbsp-padding approach for inline images in StyledText
with a single ObjectReplacementCharacter per image. QTextImageFormat
ranges are set via setFormats() so that QTextEngine correctly sizes
each inline object during itemization and shaping.

Image positioning is extracted into positionInlineImages() which
iterates over format ranges and uses objectIndex to find the
corresponding imgTag. It uses cursorToX at both edges of the inline
object to determine the left edge, handling both LTR and RTL text.

The elide path now uses QTextEngine::elidedText() for all text
formats, which correctly accounts for ObjectReplacementCharacter
widths. Image format ranges are carried into the elide layout via
elideFormats(), so positionInlineImages() works uniformly for both
the main and elide layouts.

setLineGeometry() is simplified to only handle line geometry.
positionInlineImages() is called separately after it.

The styled text parser emits ObjectReplacementCharacter only for
images with a valid URL, and resets hasSpace after it so that spaces
after an img tag are preserved symmetrically.

[ChangeLog][QtQuick][Text] Inline images in StyledText now participate
correctly in text eliding, wrapping, and line breaking.

Fixes: QTBUG-112717
Fixes: QTBUG-97536
Fixes: QTBUG-57191
Fixes: QTBUG-36163
Fixes: QTBUG-39107
Fixes: QTBUG-43820
Fixes: QTBUG-113829
Fixes: QTBUG-115285
Fixes: QTBUG-133284
Change-Id: Id2e2ce1238d521d7b901404b77af1ca30315e2b5
Reviewed-by: Eskil Abrahamsen Blomfeldt &lt;eskil.abrahamsen-blomfeldt@qt.io&gt;
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the Nbsp-padding approach for inline images in StyledText
with a single ObjectReplacementCharacter per image. QTextImageFormat
ranges are set via setFormats() so that QTextEngine correctly sizes
each inline object during itemization and shaping.

Image positioning is extracted into positionInlineImages() which
iterates over format ranges and uses objectIndex to find the
corresponding imgTag. It uses cursorToX at both edges of the inline
object to determine the left edge, handling both LTR and RTL text.

The elide path now uses QTextEngine::elidedText() for all text
formats, which correctly accounts for ObjectReplacementCharacter
widths. Image format ranges are carried into the elide layout via
elideFormats(), so positionInlineImages() works uniformly for both
the main and elide layouts.

setLineGeometry() is simplified to only handle line geometry.
positionInlineImages() is called separately after it.

The styled text parser emits ObjectReplacementCharacter only for
images with a valid URL, and resets hasSpace after it so that spaces
after an img tag are preserved symmetrically.

[ChangeLog][QtQuick][Text] Inline images in StyledText now participate
correctly in text eliding, wrapping, and line breaking.

Fixes: QTBUG-112717
Fixes: QTBUG-97536
Fixes: QTBUG-57191
Fixes: QTBUG-36163
Fixes: QTBUG-39107
Fixes: QTBUG-43820
Fixes: QTBUG-113829
Fixes: QTBUG-115285
Fixes: QTBUG-133284
Change-Id: Id2e2ce1238d521d7b901404b77af1ca30315e2b5
Reviewed-by: Eskil Abrahamsen Blomfeldt &lt;eskil.abrahamsen-blomfeldt@qt.io&gt;
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQuickStyledText: avoid unnecessary QString allocations</title>
<updated>2026-05-24T09:07:12+00:00</updated>
<author>
<name>Vladimir Belyavsky</name>
<email>belyavskyv@gmail.com</email>
</author>
<published>2026-05-22T14:46:57+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=85b583be60a7ec77ef30e018991f761f7e4e2399'/>
<id>85b583be60a7ec77ef30e018991f761f7e4e2399</id>
<content type='text'>
In parseImageAttributes(), use QStringView::toInt() directly instead
of converting to QString first. QStringView already provides toInt(),
so the intermediate toString() allocation is unnecessary.

Change-Id: I95e0a32a462c016c6acc732a0b282978afe16690
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In parseImageAttributes(), use QStringView::toInt() directly instead
of converting to QString first. QStringView already provides toInt(),
so the intermediate toString() allocation is unnecessary.

Change-Id: I95e0a32a462c016c6acc732a0b282978afe16690
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace QVector with QList</title>
<updated>2026-01-09T19:44:46+00:00</updated>
<author>
<name>Shawn Rutledge</name>
<email>shawn.rutledge@qt.io</email>
</author>
<published>2026-01-08T18:16:07+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=941445ba18c8003948dc9bb9e257114ca13e12fb'/>
<id>941445ba18c8003948dc9bb9e257114ca13e12fb</id>
<content type='text'>
Since QVector is just an alias, let's finally do what we could have
done for Qt 6.0.

Pick-to: 6.11
Change-Id: Ia9dbc8ecf4f099339cf7639acb22c14b24fa680b
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since QVector is just an alias, let's finally do what we could have
done for Qt 6.0.

Pick-to: 6.11
Change-Id: Ia9dbc8ecf4f099339cf7639acb22c14b24fa680b
Reviewed-by: Sami Shalayel &lt;sami.shalayel@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Increase robustness of &lt;img&gt; tag in Text component</title>
<updated>2025-10-31T16:16:20+00:00</updated>
<author>
<name>Eskil Abrahamsen Blomfeldt</name>
<email>eskil.abrahamsen-blomfeldt@qt.io</email>
</author>
<published>2025-10-29T08:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=4aaf9bf21f7cc69d73066785e254b664fcc82025'/>
<id>4aaf9bf21f7cc69d73066785e254b664fcc82025</id>
<content type='text'>
For Text.StyledText, there was no protection against &lt;img&gt; tags
with very large widths or heights. This could cause an application
to spend a very long time processing a layout and sometimes crash
if the size was too large.

We reuse the internal coord limit in QPainter as our maximum size
here, similar to what we do in Qt Svg for instance.

For Text.RichText, there were no issues in release builds, but in
debug builds, you could trigger an overflow assert when rounding
the number if it exceeded INT_MAX. For this, we simply cap the
width and height at INT_MAX.

Fixes: QTBUG-141515
Pick-to: 5.15 6.5 6.8 6.10
Change-Id: I4bcba16158f5f495a0de38963316effc4c46aae1
Reviewed-by: Eirik Aavitsland &lt;eirik.aavitsland@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For Text.StyledText, there was no protection against &lt;img&gt; tags
with very large widths or heights. This could cause an application
to spend a very long time processing a layout and sometimes crash
if the size was too large.

We reuse the internal coord limit in QPainter as our maximum size
here, similar to what we do in Qt Svg for instance.

For Text.RichText, there were no issues in release builds, but in
debug builds, you could trigger an overflow assert when rounding
the number if it exceeded INT_MAX. For this, we simply cap the
width and height at INT_MAX.

Fixes: QTBUG-141515
Pick-to: 5.15 6.5 6.8 6.10
Change-Id: I4bcba16158f5f495a0de38963316effc4c46aae1
Reviewed-by: Eirik Aavitsland &lt;eirik.aavitsland@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Port away from QPair</title>
<updated>2025-04-12T05:39:59+00:00</updated>
<author>
<name>Zhao Yuhang</name>
<email>2546789017@qq.com</email>
</author>
<published>2025-04-10T08:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=60297d4d1e17705c128d11a1ef6f200e59ba4708'/>
<id>60297d4d1e17705c128d11a1ef6f200e59ba4708</id>
<content type='text'>
QPair is just an alias of std::pair anyway.

Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
QPair is just an alias of std::pair anyway.

Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Mark text-related Qt Quick items as security-sensitive</title>
<updated>2025-03-11T21:34:21+00:00</updated>
<author>
<name>Shawn Rutledge</name>
<email>shawn.rutledge@qt.io</email>
</author>
<published>2025-03-10T08:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=0cecfbb46adf7360b7c6e89ce47a1f6ca10169a8'/>
<id>0cecfbb46adf7360b7c6e89ce47a1f6ca10169a8</id>
<content type='text'>
Task-number: QTBUG-132472
Task-number: QTBUG-134547
Pick-to: 6.8 6.9
Change-Id: I916d996e593a270b9e3b0c07d0a9e6338b8883fc
Reviewed-by: Richard Moe Gustavsen &lt;richard.gustavsen@qt.io&gt;
Reviewed-by: Jan Arve Sæther &lt;jan-arve.saether@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Task-number: QTBUG-132472
Task-number: QTBUG-134547
Pick-to: 6.8 6.9
Change-Id: I916d996e593a270b9e3b0c07d0a9e6338b8883fc
Reviewed-by: Richard Moe Gustavsen &lt;richard.gustavsen@qt.io&gt;
Reviewed-by: Jan Arve Sæther &lt;jan-arve.saether@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Make more logging categories static</title>
<updated>2024-06-24T07:27:30+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2024-06-21T07:10:08+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=16462f18050c5813c1676e6f7bb714a973978d42'/>
<id>16462f18050c5813c1676e6f7bb714a973978d42</id>
<content type='text'>
Non-static, non-forward-declared logging categories are deprecated.

Change-Id: Iaeb0183ef7ca05bbd0f4587166096c29825cc175
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Non-static, non-forward-declared logging categories are deprecated.

Change-Id: Iaeb0183ef7ca05bbd0f4587166096c29825cc175
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQuickStyledTextImgTag: hold QQuickPixmap as smart pointer</title>
<updated>2024-05-08T16:04:02+00:00</updated>
<author>
<name>Vladimir Belyavsky</name>
<email>belyavskyv@gmail.com</email>
</author>
<published>2024-05-07T15:26:21+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=a5edb49c8fe8ae72aaaf7fed3a3f27b3d78ea9cd'/>
<id>a5edb49c8fe8ae72aaaf7fed3a3f27b3d78ea9cd</id>
<content type='text'>
Use QScopedPointer for QQuickPixmap member of QQuickStyledTextImgTag
instead of holding it as a raw pointer. This way we make it a little
safer to use and can clean up the code a bit.

Change-Id: I98ebbe7892d4019ad305d8087bd195071fa868a4
Reviewed-by: Eskil Abrahamsen Blomfeldt &lt;eskil.abrahamsen-blomfeldt@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use QScopedPointer for QQuickPixmap member of QQuickStyledTextImgTag
instead of holding it as a raw pointer. This way we make it a little
safer to use and can clean up the code a bit.

Change-Id: I98ebbe7892d4019ad305d8087bd195071fa868a4
Reviewed-by: Eskil Abrahamsen Blomfeldt &lt;eskil.abrahamsen-blomfeldt@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
