<?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[Update after moving qgraphicstextitem]]></title><description><![CDATA[<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/846226cd-3080-4050-853e-cd6e5475728b.png" alt="82faf340-481c-4fa4-ba1a-dd23ca053347-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The graph was moved with the mouse, and the textitem was also moved according to the graph. The bottom textitem is cut off to the screen.<br />
But what's strange is that when I click or switch to another screen, it works normally.</p>
<pre><code>for (int i = 0; i &lt; this-&gt;series().count(); i++)
	{
		usrLineSeries* pSeries = qobject_cast&lt;usrLineSeries*&gt;(this-&gt;series().at(i));

		if (pSeries)
		{
			foreach(auto item, pSeries-&gt;GetTextItems())
			{
				if (!bItemVisible)
				{
					item-&gt;setVisible(bItemVisible);
				}
				else
				{
					QPointF target(item-&gt;GetOriPos());
					QPointF p = this-&gt;mapToPosition(QPointF(target), pSeries);

					if (!this-&gt;plotArea().contains(p))	// 화면 벗어나면 visible 안함
						item-&gt;setVisible(false);
					else
					{
						QPointF sPos = this-&gt;mapToScene(p.x(), p.y());
						item-&gt;setPos(sPos.x(), sPos.y());
						item-&gt;setVisible(bItemVisible);
					}
				}
			}
		}
	}
</code></pre>
]]></description><link>https://forum.qt.io/topic/134742/update-after-moving-qgraphicstextitem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 03:28:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/134742.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Mar 2022 01:07:32 GMT</pubDate><ttl>60</ttl></channel></rss>