<?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[Getting a QtChartView inside of a QGraphicsView]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">i have added a QGraphicsView to a .ui file.<br />
In the according class i make a QChartView and want to show that chart in the QGraphicsView.</p>
<p dir="auto">I have tried the following things, but they did not work:</p>
<p dir="auto">1.)<br />
QChartView* tmp = new QChartView(...);<br />
ui-&gt;graphics_view = tmp;</p>
<p dir="auto">2.)<br />
QChartView* tmp = new QChartView(...);<br />
QGraphicsView* graphics_view = new QGraphicsView(tmp);<br />
ui-&gt;graphics_view = tmp;</p>
<p dir="auto">The two methods do not work and i cannot really find a way to get a chartview inside of my graphics view.<br />
Can not be too hard to do what i want, or is it?</p>
]]></description><link>https://forum.qt.io/topic/134087/getting-a-qtchartview-inside-of-a-qgraphicsview</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 08:42:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/134087.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Feb 2022 13:31:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Getting a QtChartView inside of a QGraphicsView on Fri, 04 Feb 2022 14:13:02 GMT]]></title><description><![CDATA[<p dir="auto">i found a great answer by "eyllanesc" on stackoverflow right here:<br />
<a href="https://stackoverflow.com/questions/48362864/how-to-insert-qchartview-in-form-with-qt-designer" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/48362864/how-to-insert-qchartview-in-form-with-qt-designer</a></p>
<p dir="auto">it is possible to right click the graphics view in the ui editor and then in the menu click on promote to.<br />
There you can type "QChartView" in the promoted class name field and "QtCharts" in the Header File field.</p>
<p dir="auto">Then it is possible to go to the code and just say ui-&gt;graphics_view-&gt;setChart(&amp;chart);</p>
]]></description><link>https://forum.qt.io/post/701393</link><guid isPermaLink="true">https://forum.qt.io/post/701393</guid><dc:creator><![CDATA[MichaelH]]></dc:creator><pubDate>Fri, 04 Feb 2022 14:13:02 GMT</pubDate></item><item><title><![CDATA[Reply to Getting a QtChartView inside of a QGraphicsView on Tue, 08 Feb 2022 14:00:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/701452">Getting a QtChartView inside of a QGraphicsView</a>:</p>
<blockquote>
<p dir="auto">ce QChartView</p>
</blockquote>
<p dir="auto">Thanks for the answer.<br />
Yes i was just desperatly trying to do something..</p>
<p dir="auto">I have already fixed my issue, but thanks for another solution.</p>
]]></description><link>https://forum.qt.io/post/701790</link><guid isPermaLink="true">https://forum.qt.io/post/701790</guid><dc:creator><![CDATA[MichaelH]]></dc:creator><pubDate>Tue, 08 Feb 2022 14:00:36 GMT</pubDate></item><item><title><![CDATA[Reply to Getting a QtChartView inside of a QGraphicsView on Fri, 04 Feb 2022 20:39:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You are just replacing a pointer with something different. It's even surprising that it's compiling at all.</p>
<p dir="auto">Since QChartView is widget, use the addWidget method from the QGraphicsScene that you set on your QGraphicsView.</p>
]]></description><link>https://forum.qt.io/post/701452</link><guid isPermaLink="true">https://forum.qt.io/post/701452</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 04 Feb 2022 20:39:29 GMT</pubDate></item><item><title><![CDATA[Reply to Getting a QtChartView inside of a QGraphicsView on Fri, 04 Feb 2022 14:13:02 GMT]]></title><description><![CDATA[<p dir="auto">i found a great answer by "eyllanesc" on stackoverflow right here:<br />
<a href="https://stackoverflow.com/questions/48362864/how-to-insert-qchartview-in-form-with-qt-designer" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/48362864/how-to-insert-qchartview-in-form-with-qt-designer</a></p>
<p dir="auto">it is possible to right click the graphics view in the ui editor and then in the menu click on promote to.<br />
There you can type "QChartView" in the promoted class name field and "QtCharts" in the Header File field.</p>
<p dir="auto">Then it is possible to go to the code and just say ui-&gt;graphics_view-&gt;setChart(&amp;chart);</p>
]]></description><link>https://forum.qt.io/post/701393</link><guid isPermaLink="true">https://forum.qt.io/post/701393</guid><dc:creator><![CDATA[MichaelH]]></dc:creator><pubDate>Fri, 04 Feb 2022 14:13:02 GMT</pubDate></item></channel></rss>