[Interest] Container members in abstract base class?

André Somers andre at familiesomers.nl
Thu May 23 09:47:38 CEST 2013

Op 22-5-2013 22:42, Jonathan Greig schreef:
> I did check the qobject_cast docs and noticed that, but I wasn't 
> inheriting from QObject and haven't needed signals or slots in the 
> items in my scene. I'm trying to keep the item classes as light as 
> possible for speed and memory. The items are CAD objects, so "40,000 
> chips" demo is in line with what I'm trying to achieve. I'm in charge 
> of GUI/Linux development on Embroidermodder 2. It's not uncommon to 
> have more than 10,000 stitches in a design file.
Obviously. I did notice that you were using QGraphicsItem, and I 
realized that that doesn't inherit QObject, hence the original 
suggestion to use dynamic_cast<>. The reply was aimed at Thiago's 
comment, not at your orignal problem anymore. Specifically at this comment:

 >> And another rule of thumb: dynamic_casts are always checked[*], all 
the other casts are never checked.


> - Swyped from my droid.
>> On May 22, 2013 3:13 PM, "Andre Somers" <andre at familiesomers.nl 
>> <mailto:andre at familiesomers.nl>> wrote:
>> Op 22-5-2013 21:34, Thiago Macieira schreef:
>> > On quarta-feira, 22 de maio de 2013 16.52.29, Jonathan Greig wrote:
>> >> Thank you André. The dynami...
>> You're overlooking our very own qobject_cast. That one works on QObject
>> derived classes without requiring the use of RTTI in the compiler, and
>> work across library boundaries. So, if your class inherits QObject, I'd
>> prefer qobject_cast instead.
>> André
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org <mailto:Interest at qt-project.org>
>> http:...

You like Qt?
I am looking for collegues to join me at i-Optics!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130523/4e63799e/attachment.html>

More information about the Interest mailing list