<?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[QString % symbol]]></title><description><![CDATA[<p dir="auto">How do you add a % symbol to a string built with QString?</p>
<p dir="auto">For example I have:</p>
<pre><code>QString strStyle(QString("QSlider::groove{background:transparent;}"
                         "QSlider::handle:vertical{"
                         "background:black;"
                         "border-radius:0px"
                         "border:1px solid gray;"
                         "height:%1&amp;#37;}").arg(dblPercentOnView));
</code></pre>
<p dir="auto">The <strong>&amp;</strong>#<strong><strong>3</strong></strong><strong>7;</strong> doesn't work.</p>
]]></description><link>https://forum.qt.io/topic/130067/qstring-symbol</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 06:16:38 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/130067.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Sep 2021 13:14:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QString % symbol on Mon, 06 Sep 2021 13:25:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> , actually its quite simple:</p>
<pre><code>QString strStyle(QString("QSlider::groove{background:transparent;}"
                         "QSlider::handle:vertical{"
                         "background:black;"
                         "border-radius:0px"
                         "border:1px solid gray;"
                         "height:%1%2;}").arg(dblPercentOnView).arg("%"));
</code></pre>
]]></description><link>https://forum.qt.io/post/679401</link><guid isPermaLink="true">https://forum.qt.io/post/679401</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 06 Sep 2021 13:25:00 GMT</pubDate></item><item><title><![CDATA[Reply to QString % symbol on Mon, 06 Sep 2021 19:43:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/679401">QString % symbol</a>:</p>
<blockquote>
<p dir="auto"><code>"height:%1%2;}").arg(dblPercentOnView).arg("%"));</code></p>
</blockquote>
<p dir="auto">For a literal <code>%</code> you should find <code>QString</code> accepts <code>%%</code>, so I would find simpler/more readable</p>
<pre><code>"height:%1%%;}").arg(dblPercentOnView));`
</code></pre>
]]></description><link>https://forum.qt.io/post/679435</link><guid isPermaLink="true">https://forum.qt.io/post/679435</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 06 Sep 2021 19:43:19 GMT</pubDate></item><item><title><![CDATA[Reply to QString % symbol on Mon, 06 Sep 2021 13:40:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , doesn't % denote a parameter expected?</p>
]]></description><link>https://forum.qt.io/post/679404</link><guid isPermaLink="true">https://forum.qt.io/post/679404</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 06 Sep 2021 13:40:54 GMT</pubDate></item><item><title><![CDATA[Reply to QString % symbol on Mon, 06 Sep 2021 13:39:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/679401">QString % symbol</a>:</p>
<blockquote>
<p dir="auto">actually its quite simple:</p>
</blockquote>
<p dir="auto">Or even easier with:</p>
<pre><code>QString strStyle(QString("QSlider::groove{background:transparent;}"
                         "QSlider::handle:vertical{"
                         "background:black;"
                         "border-radius:0px"
                         "border:1px solid gray;"
                         "height:%1%;}").arg(dblPercentOnView));
</code></pre>
]]></description><link>https://forum.qt.io/post/679403</link><guid isPermaLink="true">https://forum.qt.io/post/679403</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Mon, 06 Sep 2021 13:39:32 GMT</pubDate></item><item><title><![CDATA[Reply to QString % symbol on Mon, 06 Sep 2021 13:25:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> , actually its quite simple:</p>
<pre><code>QString strStyle(QString("QSlider::groove{background:transparent;}"
                         "QSlider::handle:vertical{"
                         "background:black;"
                         "border-radius:0px"
                         "border:1px solid gray;"
                         "height:%1%2;}").arg(dblPercentOnView).arg("%"));
</code></pre>
]]></description><link>https://forum.qt.io/post/679401</link><guid isPermaLink="true">https://forum.qt.io/post/679401</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Mon, 06 Sep 2021 13:25:00 GMT</pubDate></item></channel></rss>