<?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[Why is QString(char*) private in trunk?]]></title><description><![CDATA[<p dir="auto">In qstring.h these methods are now private, I checked the qt5 trunk out from git:</p>
<p dir="auto">private:<br />
#if defined(QT_NO_CAST_FROM_ASCII)<br />
QString &amp;operator+=(const char *s);<br />
QString &amp;operator+=(const QByteArray &amp;s);<br />
QString(const char *ch);<br />
QString(const QByteArray &amp;a);<br />
QString &amp;operator=(const char  *ch);<br />
QString &amp;operator=(const QByteArray &amp;a);<br />
#endif</p>
<p dir="auto">Why? This is going to make a lot of code uglier, I now have to wrap every single function call where I used to be able to say "string.split("HI")" with "string.split(QString.fromUtf8("HI")"</p>
]]></description><link>https://forum.qt.io/topic/46669/why-is-qstring-char-private-in-trunk</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 09:51:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/46669.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 04 Oct 2014 18:19:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why is QString(char*) private in trunk? on Sun, 05 Oct 2014 06:49:52 GMT]]></title><description><![CDATA[<p dir="auto">There are different approaches to making something multilingual, in any case I would rather have the option of coding as fast as possible and worry about business decisions at a point of time of my choosing.</p>
]]></description><link>https://forum.qt.io/post/246267</link><guid isPermaLink="true">https://forum.qt.io/post/246267</guid><dc:creator><![CDATA[Meai]]></dc:creator><pubDate>Sun, 05 Oct 2014 06:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to Why is QString(char*) private in trunk? on Sat, 04 Oct 2014 22:34:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi, also you can use<br />
@<br />
string.split(tr("Hi"));<br />
@</p>
<p dir="auto">it's useful in those environments where QString(char*) is private 100% of the time, for example when you're writing a Qt Creator plugin.</p>
<p dir="auto">As SGaist suggests, it's a good idea always to put your hardcoded strings inside a function anyway, because maybe your product is a success and you have to translate it to another language!</p>
]]></description><link>https://forum.qt.io/post/246257</link><guid isPermaLink="true">https://forum.qt.io/post/246257</guid><dc:creator><![CDATA[hskoglund]]></dc:creator><pubDate>Sat, 04 Oct 2014 22:34:20 GMT</pubDate></item><item><title><![CDATA[Reply to Why is QString(char*) private in trunk? on Sat, 04 Oct 2014 20:02:38 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Look upper in the header file under the "// ASCII compatibility" comment, you'll see that if you don't define QT_NO_CAST_FROM_ASCII the methods are public.</p>
<p dir="auto">As for the rest you would rather use:</p>
<p dir="auto">@string.split(QLatin1String("Hi"));@</p>
<p dir="auto">The reasoning behind is explained in the documentation of QString and QLatin1String</p>
]]></description><link>https://forum.qt.io/post/246238</link><guid isPermaLink="true">https://forum.qt.io/post/246238</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 04 Oct 2014 20:02:38 GMT</pubDate></item></channel></rss>