<?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[QPainter zero point bug]]></title><description><![CDATA[<p dir="auto">So here is the code</p>
<pre><code>void SButton::paintEvent(QPaintEvent* event)
{
	QPushButton::paintEvent(event);

	if (m_strikeout == true)
	{
		QPainter painter;
		painter.begin(this);
		painter.setPen(QColor(0, 0, 0));
		QRectF br = rect();
		br.adjust(m_margin_left, m_margin_top, -m_margin_right, -m_margin_bottom - m_o_label-&gt;size().height());
		painter.drawRect(br);
		painter.end();
	}
}
</code></pre>
<p dir="auto">br is 19;19;341;251</p>
<p dir="auto">here screens from 2 different PCs with SAME version of windows/directX ..., but with different hardware (processor and video)<br />
First:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/c548afef-8c32-4551-884f-11cedf09f01b.png" alt="1_1551455944982_pc_2.png" class=" img-fluid img-markdown" /><br />
Second:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/5bf12215-d6ba-4376-af9f-8263cfdb9394.png" alt="0_1551455944981_pc_1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Upper left point is 0;0 point of my SButton widget</p>
<p dir="auto">How does it works? i'm very confused</p>
<p dir="auto">I try change Qrect to QrectF, draw lines and other stuff, on second PC i always got +1px at height</p>
]]></description><link>https://forum.qt.io/topic/100262/qpainter-zero-point-bug</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 15:47:21 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/100262.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 01 Mar 2019 16:02:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QPainter zero point bug on Fri, 01 Mar 2019 17:37:10 GMT]]></title><description><![CDATA[<p dir="auto">kind of shooting in the dark here, but remember that the painter coordinate system can be scaled, rotated, and new origin set.  Try explicitly defining the coordinate system...Also, if your coordinates are floating point then you have to deal with floating point roundoff error.</p>
]]></description><link>https://forum.qt.io/post/514873</link><guid isPermaLink="true">https://forum.qt.io/post/514873</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Fri, 01 Mar 2019 17:37:10 GMT</pubDate></item></channel></rss>