<?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[QLabel.setText() Vs. QPainter.drawText()]]></title><description><![CDATA[<p dir="auto">hi-</p>
<p dir="auto">I would like to draw dynamic labels on GL Widget (every frame the text is changing).<br />
is there a difference between QLabel.setText() and QPainter.drawText()?<br />
what's more efficient?<br />
note that:</p>
<ul>
<li>the setting of these labels is done through paintGL() override function</li>
<li>if i'll use QLabel- i can initialize labels on Init() func (called only once), so maybe its more efficient using QLabel??</li>
</ul>
<p dir="auto">thanks!</p>
]]></description><link>https://forum.qt.io/topic/105653/qlabel-settext-vs-qpainter-drawtext</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 08:56:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/105653.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Aug 2019 10:12:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QLabel.setText() Vs. QPainter.drawText() on Tue, 06 Aug 2019 05:21:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I understand, tnx!</p>
]]></description><link>https://forum.qt.io/post/544856</link><guid isPermaLink="true">https://forum.qt.io/post/544856</guid><dc:creator><![CDATA[moriailan]]></dc:creator><pubDate>Tue, 06 Aug 2019 05:21:22 GMT</pubDate></item><item><title><![CDATA[Reply to QLabel.setText() Vs. QPainter.drawText() on Mon, 05 Aug 2019 11:37:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
if you check QLables paintevent here<br />
<a href="https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qlabel.cpp.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qlabel.cpp.html</a><br />
You can see its pretty huge.<br />
so my guess would be qpainter drawText is faster, solely due to much less instruction pr frame to process.</p>
]]></description><link>https://forum.qt.io/post/544733</link><guid isPermaLink="true">https://forum.qt.io/post/544733</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Mon, 05 Aug 2019 11:37:40 GMT</pubDate></item></channel></rss>