<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1]]></title><description><![CDATA[<p dir="auto">TL;DR: <code>QString</code> deprecated in 6.12.0 and removed in 6.12.1.4.1</p>
<h1>Summary</h1>
<p dir="auto">In the long tradition of improving Qt’s string‑handling robustness and eliminating unnecessary heap traffic wherever possible, we are taking the next logical step in the evolution of Qt APIs:<br />
<code>QString</code> will be deprecated in Qt 6.12.0 and scheduled for complete removal in Qt 6.12.1.4.1<br />
This change has been a long time coming. In fact, several of us remember the hallway conversations going back to 2008, predicting the unavoidable sunset of <code>QString</code>. At the time, this was dismissed as academic speculation. But with the proliferation of string‑view types in Qt 6, the ecosystem is finally ready.</p>
<h1>Rationale</h1>
<p dir="auto">As everyone who has followed Qt’s architecture work over the years knows, <code>QString</code> has historically been the primary source of:</p>
<ul>
<li>silent heap allocations,</li>
<li>shared‑data aliasing footguns,</li>
<li>UTF‑16 monoculture,</li>
<li>and the false security that a string class could ever be both “easy to use” and “correct”.</li>
</ul>
<p dir="auto">The new design philosophy is simple:<br />
<em>Every string is a view, and every view can be viewed differently.</em></p>
<p dir="auto">To that end, we are delighted to promote the increasingly mature family of modern C++‑compatible string‑view types, including but absolutely not limited to:</p>
<pre><code>QStringView
QLatin1StringView
QConstLatin1StringView
QUtf8StringView
QAnyAprilStringView
QTranscendentStringView
QPossiblyDanglingButDefinitelyNotOwnedView
QTerseYetHyperSpecificStringView
QNonOwningCharacterRangeOfUnclearLifetimeView
QOverView
</code></pre>
<p dir="auto">...and, starting in 6.12, the new<br />
<code>QViewOfAViewOfAView</code>, providing an overview over a <code>QStringView</code> over a <code>QByteArrayView</code> over an implementation detail I don't even remotely understand. My only code comment (requiring to add an autotest) caused a shit storm.</p>
<p dir="auto">All of these share one important characteristic:<br />
<em><strong>They do not own memory.</strong></em> Whether you own the memory is, of course, your own responsibility.<br />
This aligns with long‑standing architectural recommendations from an undisclosed colleague, who has consistently reminded us that if anything touches the heap, it is already too late.</p>
<h1>Acknowledgements</h1>
<p dir="auto">A special thank‑you to <a class="plugin-mentions-user plugin-mentions-a" href="/user/mike-trahearn-0">@<bdi>Mike-Trahearn-0</bdi></a>, who has for many years been a leading advocate of stringless frameworks. His internal write‑up, “If you need to print text, you already made a design mistake”, has been inspirational to many of us.<br />
On a personal note as a double bass player, I’ve always considered <code>QString</code> problematic at the conceptual level: I prefer <code>[E|A|D|G]String</code>. Strings that actually exist on an instrument — unlike <code>QString</code>, which, as far as I can tell, neither electric bass, upright bass, nor any orchestral string instrument has ever implemented. Let's not descend into the abyss of <code>BString</code> (aka <code>HString</code>), used by <code>5String</code> basses. IMHO this evil should have been deprecated before its invention.</p>
<h1>Migration Plan</h1>
<h4>Starting in Qt 6.12.0:</h4>
<p dir="auto">Using <code>QString</code> will trigger a deprecation warning narrowing the 47 recommended string‑view variants down to a maximum of 16 (0x10).<br />
Which one is recommended depends entirely on context, encoding, meteorological patterns, phase of the moon and, of course your <code>CMake</code> version.</p>
<h4>Starting in Qt 6.12.1.4.1:</h4>
<p dir="auto"><code>QString</code> will be removed.<br />
Code referencing it will fail to compile with a diagnostic explaining that text output is discouraged.<br />
<code>Qt::NoStringsAttached</code> becomes the default build mode.</p>
<h1>Frequently anticipated questions (A&amp;Q)</h1>
<h5>Q: Why now?</h5>
<p dir="auto">A: Because we can.</p>
<h5>Q: Will it break my application?</h5>
<p dir="auto">A: Only the parts using <code>QString</code> (raughly 98%).</p>
<h5>Q: Which string view class suits my use case best?</h5>
<p dir="auto">A: Yes.</p>
<h5>Q: Do you provide migration tooling?</h5>
<p dir="auto">We will provide <code>QStringCutter</code> that replaces all occurrences of <code>QString</code> with one of the recommended views (see illustration below).</p>
<h5>Q: Are you serious?</h5>
<p dir="auto">Check this simple snippet. If it compiles and prints output, you are ready to go.</p>
<pre><code>if (QDate::currentDate() == QDate(2026, 4, 1))
    qInfo() &lt;&lt; "Relax. It's an April Fools' prank. QString is safe.";
</code></pre>
<p dir="auto">Yours stringcerely,<br />
Axel SpÃ¶rl</p>
<hr />
<p dir="auto"><code>QStringCutter</code> v0beta1 design flow chart:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/7084cdc6-fdbe-4930-b8f0-041005bf6241.png" alt="545c7db5-5939-4c2d-a773-f23af1f4b391-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/164507/qt-6.12-deprecation-of-qstring-in-6.12.0-and-complete-removal-in-6.12.1.4.1</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 04:01:24 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164507.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Apr 2026 15:14:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 07:52:26 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">and complete removal in 6.12.1.4.1</p>
</blockquote>
<p dir="auto">I could not believe they would remove it in a minor, minor release! :)</p>
]]></description><link>https://forum.qt.io/post/837501</link><guid isPermaLink="true">https://forum.qt.io/post/837501</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 02 Apr 2026 07:52:26 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 15:08:23 GMT]]></title><description><![CDATA[<p dir="auto">My life is now complete, as I have seen my first "A&amp;Q"</p>
<p dir="auto">Well done. A pattern I will strive to emulate in future (seasonal) announcements. 🫶</p>
]]></description><link>https://forum.qt.io/post/837516</link><guid isPermaLink="true">https://forum.qt.io/post/837516</guid><dc:creator><![CDATA[KH-219Design]]></dc:creator><pubDate>Thu, 02 Apr 2026 15:08:23 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 11:12:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sbela">@<bdi>sbela</bdi></a> We don't really need all those Qt classes to inherit from <code>QObject</code>, do we!</p>
]]></description><link>https://forum.qt.io/post/837508</link><guid isPermaLink="true">https://forum.qt.io/post/837508</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 02 Apr 2026 11:12:45 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 09:14:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> You might be right! I have never write code like:</p>
<pre><code>QObject *obj ... ;
</code></pre>
]]></description><link>https://forum.qt.io/post/837505</link><guid isPermaLink="true">https://forum.qt.io/post/837505</guid><dc:creator><![CDATA[sbela]]></dc:creator><pubDate>Thu, 02 Apr 2026 09:14:14 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 08:47:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/axel-spoerl">@<bdi>Axel-Spoerl</bdi></a><br />
You might consider removing <code>QObject</code> at the same time, as that is rarely needed with Qt.</p>
]]></description><link>https://forum.qt.io/post/837504</link><guid isPermaLink="true">https://forum.qt.io/post/837504</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 02 Apr 2026 08:47:44 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 07:59:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> That is, as always with Jon, a strong argument.<br />
We have decided to pause the initiative for a year.</p>
]]></description><link>https://forum.qt.io/post/837502</link><guid isPermaLink="true">https://forum.qt.io/post/837502</guid><dc:creator><![CDATA[Axel Spoerl]]></dc:creator><pubDate>Thu, 02 Apr 2026 07:59:26 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 07:52:26 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">and complete removal in 6.12.1.4.1</p>
</blockquote>
<p dir="auto">I could not believe they would remove it in a minor, minor release! :)</p>
]]></description><link>https://forum.qt.io/post/837501</link><guid isPermaLink="true">https://forum.qt.io/post/837501</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 02 Apr 2026 07:52:26 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Thu, 02 Apr 2026 03:28:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/axel-spoerl">@<bdi>Axel-Spoerl</bdi></a></p>
<blockquote>
<p dir="auto">and the false security that a string class could ever be both “easy to use” and “correct”.</p>
</blockquote>
<p dir="auto">That made my day :)</p>
]]></description><link>https://forum.qt.io/post/837495</link><guid isPermaLink="true">https://forum.qt.io/post/837495</guid><dc:creator><![CDATA[aha_1980]]></dc:creator><pubDate>Thu, 02 Apr 2026 03:28:24 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Wed, 01 Apr 2026 18:04:49 GMT]]></title><description><![CDATA[<p dir="auto">Ha, good one! Of course QString needs to go :D I propose to replace it with AiString which just automatically knows what data it should hold based on the context.<br />
The only downside is when servers are down or the model starts hallucinating, but it is only a minor annoyance.</p>
]]></description><link>https://forum.qt.io/post/837490</link><guid isPermaLink="true">https://forum.qt.io/post/837490</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Wed, 01 Apr 2026 18:04:49 GMT</pubDate></item><item><title><![CDATA[Reply to [Qt 6.12] Deprecation of QString in 6.12.0 and complete removal in 6.12.1.4.1 on Wed, 01 Apr 2026 16:56:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/axel-spoerl">@<bdi>Axel-Spoerl</bdi></a> Didn't like the look of the title when I first espied it!</p>
]]></description><link>https://forum.qt.io/post/837488</link><guid isPermaLink="true">https://forum.qt.io/post/837488</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 01 Apr 2026 16:56:49 GMT</pubDate></item></channel></rss>