<?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[About algorithm render tachometer gauge on embedded catalog example and demo]]></title><description><![CDATA[<p dir="auto">I read source code in file qtsvgdialgauge.cpp and qtsvgdialgauge.h and in method QtSvgDialGauge::paintEvent I don't understand code lines:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> QtSvgDialGauge::setNeedleOrigin(qreal x, qreal y)<br />
{<br />
m_originX = qMin(static_cast&lt;qreal&gt;(1.0), qMax(static_cast&lt;qreal&gt;(0.0), x));<br />
m_originY = qMin(static_cast&lt;qreal&gt;(1.0), qMax(static_cast&lt;qreal&gt;(0.0), y));<br />
}@<br />
what is needle origin ,....<br />
@// Tachometer<br />
QtSvgDialGauge *gauge = new QtSvgDialGauge(group);<br />
gauge-&gt;setSkin("Tachometer");<br />
gauge-&gt;setNeedleOrigin(0.486, 0.466);@<br />
why is 0.486 and 0.466<br />
please help me understand this. Thank in advance!</p>
<p dir="auto">[edit : Please use code tags (@ before and after your code) , Eddy]</p>
]]></description><link>https://forum.qt.io/topic/9821/about-algorithm-render-tachometer-gauge-on-embedded-catalog-example-and-demo</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 00:33:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/9821.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Sep 2011 10:22:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to About algorithm render tachometer gauge on embedded catalog example and demo on Sun, 25 Sep 2011 20:07:16 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="banlinhtienphong" date="1316958365"]I still don't understand why make sure y is between 0 and 1?[/quote] I assume the coordinates need to be defined within the square (0.0,0.0)-(1.0,1.0). If that's the case, they're making sure the needle origin is within sight.</p>
<p dir="auto">[quote author="banlinhtienphong" date="1316958365"]<br />
I think 0.486 and 0.466 not "it probably looks best..."<br />
anyone can explain for me?[/quote]What don't you understand? Do you not understand why the needle origin is just a tad off-center (so not (0.5, 0.5))? Do you not understand what the needle origin is to begin with?</p>
<p dir="auto">It seems you're a non-native English speaker, and I understand that can make it harder to write, but please try to state what exactly you're having trouble with.</p>
]]></description><link>https://forum.qt.io/post/110876</link><guid isPermaLink="true">https://forum.qt.io/post/110876</guid><dc:creator><![CDATA[Franzk]]></dc:creator><pubDate>Sun, 25 Sep 2011 20:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to About algorithm render tachometer gauge on embedded catalog example and demo on Sun, 25 Sep 2011 13:46:05 GMT]]></title><description><![CDATA[<p dir="auto">I still don't understand why make sure y is between 0 and 1?<br />
I think 0.486 and 0.466 not "it probably looks best..."<br />
anyone can explain for me?</p>
]]></description><link>https://forum.qt.io/post/110835</link><guid isPermaLink="true">https://forum.qt.io/post/110835</guid><dc:creator><![CDATA[banlinhtienphong]]></dc:creator><pubDate>Sun, 25 Sep 2011 13:46:05 GMT</pubDate></item><item><title><![CDATA[Reply to About algorithm render tachometer gauge on embedded catalog example and demo on Sun, 25 Sep 2011 12:12:55 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
void QtSvgDialGauge::setNeedleOrigin(qreal x, qreal y)<br />
{<br />
// make sure x is between 0 and 1<br />
m_originX = qMin( // originX = the smaller value of<br />
static_cast&lt;qreal&gt;(1.0),     // 1 and<br />
qMax(                        // the bigger value of<br />
static_cast&lt;qreal&gt;(0.0), // 0 and<br />
x));                     // x</p>
<pre><code>// make sure y is between 0 and 1
m_originY = qMin(static_cast&lt;qreal&gt;(1.0), qMax(static_cast&lt;qreal&gt;(0.0), y));
</code></pre>
<p dir="auto">}@</p>
<p dir="auto">[quote]<br />
@// Tachometer<br />
QtSvgDialGauge *gauge = new QtSvgDialGauge(group);<br />
gauge-&gt;setSkin("Tachometer");<br />
gauge-&gt;setNeedleOrigin(0.486, 0.466);<br />
@</p>
<p dir="auto">why is 0.486 and 0.466<br />
[/quote]<br />
It probably looks best...</p>
]]></description><link>https://forum.qt.io/post/110834</link><guid isPermaLink="true">https://forum.qt.io/post/110834</guid><dc:creator><![CDATA[Franzk]]></dc:creator><pubDate>Sun, 25 Sep 2011 12:12:55 GMT</pubDate></item></channel></rss>