There's also qgraphicsitem_cast made specifically for casting to classes derived from QGraphicsItem. On May 23, 2013 11:47 AM, "André Somers" <an...@familiesomers.nl> wrote:
> 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. > > André > > - Swyped from my droid. > > On May 22, 2013 3:13 PM, "Andre Somers" <an...@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@qt-project.org > http:... > > > > -- > You like Qt? > I am looking for collegues to join me at i-Optics! > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest