<?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[Do QGrahpicsItems need to be dynamicall allocated?]]></title><description><![CDATA[<p dir="auto">I'm working on porting my PyQt app to C++, I've always run into a few bumps here and there, but for the most part it's been pretty smooth.  The app makes heavy use of the QGraphicsView Framework.</p>
<p dir="auto">So let's say I had an object "A," that is a sublcass of "QGraphicsObject,"  A has a method ".size()," which will return a QSize.  It also has some calls to qDebug() in its constructor.</p>
<p dir="auto">When I made a static instance of A (identified by "b,"), I didn't see any output on the terminal and I got an error like this:</p>
<p dir="auto">@main.cpp:22:4: error: request for member ‘info’ in ‘b’, which is of non-class type ‘A()’<br />
b.size();<br />
@</p>
<p dir="auto">When I did a dynamically allocated instance, it worked fine and I saw a message on the terminal.</p>
<p dir="auto">Can someone explain what's up with this here?</p>
]]></description><link>https://forum.qt.io/topic/47437/do-qgrahpicsitems-need-to-be-dynamicall-allocated</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 18:23:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/47437.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 26 Oct 2014 00:56:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Tue, 28 Oct 2014 22:11:20 GMT]]></title><description><![CDATA[<p dir="auto">It might be because I forogt to add the "explicit," keyword to my constrcutors.  My Bad....</p>
]]></description><link>https://forum.qt.io/post/249316</link><guid isPermaLink="true">https://forum.qt.io/post/249316</guid><dc:creator><![CDATA[cuddlykittens11]]></dc:creator><pubDate>Tue, 28 Oct 2014 22:11:20 GMT</pubDate></item><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Tue, 28 Oct 2014 08:07:58 GMT]]></title><description><![CDATA[<p dir="auto">Ok, it's clearer now, I've misread your initial post…</p>
<p dir="auto">What parameters are you giving that makes it fail ?</p>
]]></description><link>https://forum.qt.io/post/249226</link><guid isPermaLink="true">https://forum.qt.io/post/249226</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 28 Oct 2014 08:07:58 GMT</pubDate></item><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Tue, 28 Oct 2014 00:25:31 GMT]]></title><description><![CDATA[<p dir="auto">When I do:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/a">@<bdi>A</bdi></a> b(/<em>parameters</em>/)@<br />
The complilation fails.</p>
<p dir="auto">If I do:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/a">@<bdi>A</bdi></a> b;@<br />
(Using either default or no parameters), it works out fine.</p>
<p dir="auto">And if I do:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/a">@<bdi>A</bdi></a> *b = new A(/<em>parameters</em>/);@<br />
It works fine.</p>
]]></description><link>https://forum.qt.io/post/249209</link><guid isPermaLink="true">https://forum.qt.io/post/249209</guid><dc:creator><![CDATA[cuddlykittens11]]></dc:creator><pubDate>Tue, 28 Oct 2014 00:25:31 GMT</pubDate></item><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Tue, 28 Oct 2014 00:00:50 GMT]]></title><description><![CDATA[<p dir="auto">My question was not clear enough.</p>
<p dir="auto">Can you post the code that is failing and then one that is successful ?</p>
]]></description><link>https://forum.qt.io/post/249206</link><guid isPermaLink="true">https://forum.qt.io/post/249206</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 28 Oct 2014 00:00:50 GMT</pubDate></item><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Mon, 27 Oct 2014 00:01:42 GMT]]></title><description><![CDATA[<p dir="auto">The second one.</p>
]]></description><link>https://forum.qt.io/post/249077</link><guid isPermaLink="true">https://forum.qt.io/post/249077</guid><dc:creator><![CDATA[cuddlykittens11]]></dc:creator><pubDate>Mon, 27 Oct 2014 00:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to Do QGrahpicsItems need to be dynamicall allocated? on Sun, 26 Oct 2014 20:40:25 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Do you mean something like:</p>
<p dir="auto">@b = A@</p>
<p dir="auto">vs</p>
<p dir="auto">@b = A()@</p>
<p dir="auto">?</p>
]]></description><link>https://forum.qt.io/post/249048</link><guid isPermaLink="true">https://forum.qt.io/post/249048</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 26 Oct 2014 20:40:25 GMT</pubDate></item></channel></rss>