<?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[QGraphicsItemGroup tooltip shown in the wrong place]]></title><description><![CDATA[<p dir="auto">I use <code>PySide2</code> v5.14.1 on Debian. There's a class that inherits from <code>QGraphicsItemGroup</code> to create and manage multiple <code>QGraphicsEllipseItem</code> as if they're one logical entity. I set a tooltip for the group and it works as expected.</p>
<p dir="auto">However, if I move my group to some other place on the <code>QGraphicsScene</code>, hovering the mouse over the object does not produce a tooltip. At the same time, I noticed that if I move the mouse to the old location of my object - the tooltip is shown, as if my object is still there at the old coordinates.</p>
<ol>
<li>How can one ensure that the tooltip moves along with the object?</li>
<li>Is it possible in principle?</li>
</ol>
<p dir="auto">Any suggestions on how to troubleshoot this would be greatly appreciated.</p>
]]></description><link>https://forum.qt.io/topic/120884/qgraphicsitemgroup-tooltip-shown-in-the-wrong-place</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 04:03:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/120884.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Nov 2020 13:01:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QGraphicsItemGroup tooltip shown in the wrong place on Tue, 17 Nov 2020 13:09:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ralienpp">@<bdi>ralienpp</bdi></a> said in <a href="/post/627788">QGraphicsItemGroup tooltip shown in the wrong place</a>:</p>
<blockquote>
<p dir="auto">thus, everything was visually in the correct location<br />
but logically the group was still in its old place</p>
</blockquote>
<p dir="auto">Yes, exactly :)</p>
<blockquote>
<p dir="auto">one needs to ensure that the update method calls self.setPos(...) somewhere</p>
</blockquote>
<p dir="auto">This should happen automatically, if your subclass is correct (every change passed to base class). Usually there's no need to call <code>update()</code> to make position changes.<br />
If you move your custom item by e.g. mouse dragging the moveEvent is propagated to the base class <code>QGraphicsItem</code> or <code>-Group</code> which holds the position. Your position change was probably made only in your subclass, which paints your item at that position, but won't move it.</p>
]]></description><link>https://forum.qt.io/post/627801</link><guid isPermaLink="true">https://forum.qt.io/post/627801</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Tue, 17 Nov 2020 13:09:27 GMT</pubDate></item><item><title><![CDATA[Reply to QGraphicsItemGroup tooltip shown in the wrong place on Tue, 17 Nov 2020 11:59:43 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your reply - you are right, the position of the group was indeed not updated.</p>
<p dir="auto">For the benefit of future archaeologists digging in this area, here are some additional clues:</p>
<ul>
<li>the <code>update</code> method of my subclass was changing the position of the group's individual elements,</li>
<li>but not the position of the group itself</li>
<li>thus, everything was visually in the correct location</li>
<li>but logically the group was still in its old place</li>
</ul>
<p dir="auto">Therefore, one needs to ensure that the <code>update</code> method calls <code>self.setPos(...)</code> somewhere.</p>
]]></description><link>https://forum.qt.io/post/627788</link><guid isPermaLink="true">https://forum.qt.io/post/627788</guid><dc:creator><![CDATA[ralienpp]]></dc:creator><pubDate>Tue, 17 Nov 2020 11:59:43 GMT</pubDate></item><item><title><![CDATA[Reply to QGraphicsItemGroup tooltip shown in the wrong place on Mon, 16 Nov 2020 14:20:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ralienpp">@<bdi>ralienpp</bdi></a></p>
<p dir="auto">Show your subclass.<br />
I bet, you forgot to pass the new position to its base class, so that from scene's point of view, the item is still at its old position, which triggers the tooltip there.</p>
]]></description><link>https://forum.qt.io/post/627547</link><guid isPermaLink="true">https://forum.qt.io/post/627547</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Mon, 16 Nov 2020 14:20:54 GMT</pubDate></item></channel></rss>