<?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[How to use qgraphicsitem in qtchart?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I want to display various custom shapes, image and lines in qtchart.<br />
QChart does not inherit from QGraphicsScene, how do I use qgraphicitem ?<br />
And the use coordinates of qgraphicsitem want to use the x, y coordinate system of qchart.</p>
<p dir="auto">thanks.</p>
]]></description><link>https://forum.qt.io/topic/79946/how-to-use-qgraphicsitem-in-qtchart</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 14:16:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/79946.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Jun 2017 08:39:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to use qgraphicsitem in qtchart? on Mon, 05 Jun 2017 15:01:45 GMT]]></title><description><![CDATA[<p dir="auto">QChart is descendant of QGraphicsWidget which in term is descendant of QGraphicsItem<br />
So it's meant to be placed in a QGraphicsScene within QGraphicsView::scene().</p>
<p dir="auto">You can use QGraphicsView to render your QChart as well as any other customized QGraphicsItem.<br />
You have first to subclass QGraphicsView, within the constructor, you can call the virtual method scene() .<br />
Which would you able add QCharts and other QGraphicsItem objects. i.e. scene()-&gt;addItem(new QChart) or scene()-&gt;addItem(new QGraphicsItem).</p>
<p dir="auto">And for the coordinates of QChart, I am not quite sure, but you might  subclass a QGraphicsItem parent it to the QChart and override it's paint method</p>
<pre><code>void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget);
</code></pre>
<p dir="auto">to draw custom shapes within the QCharts coordinate system using QPainter.</p>
]]></description><link>https://forum.qt.io/post/397384</link><guid isPermaLink="true">https://forum.qt.io/post/397384</guid><dc:creator><![CDATA[m. selim]]></dc:creator><pubDate>Mon, 05 Jun 2017 15:01:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to use qgraphicsitem in qtchart? on Mon, 05 Jun 2017 08:45:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/daryong">@<bdi>Daryong</bdi></a><br />
Hi<br />
There is not something like<br />
app-&gt;chart()-&gt;scene()  ?</p>
]]></description><link>https://forum.qt.io/post/397319</link><guid isPermaLink="true">https://forum.qt.io/post/397319</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Mon, 05 Jun 2017 08:45:25 GMT</pubDate></item></channel></rss>