[Qt-interest] (QWidget *) arriving through QGraphicsItem::paint(...) is not the (QGraphicsView *) expected
Anton Chernov
mechernov at gmail.com
Sat Jul 16 09:38:49 CEST 2011
http://doc.qt.nokia.com/latest/qgraphicsscene.html#views
the rest you can choose - either setting an object name
http://doc.qt.nokia.com/latest/qobject.html#objectName-prop
or a map of pointers, or just the index...
2011/7/15 Sherif Ghali <sherif.ghali.1 at gmail.com>:
> When visualizing 3D data the following problem arises. MyGraphicsItem
> is the child of both QGraphicsItem as well as a class for spherical
> polygons, Polygon_S2. Polygon_S2 maintains the 3D vector data, but
> before painting itself, it consults the instance of MyGraphicsView, a
> child of QGraphicsView, asking for the transformation to apply for
> that particular view.
>
> Here is what is happening. The single instance of MyGraphicsView that
> I construct is not the same object (QWidget *) that
> QGraphicsItem::paint(..) is receiving via its third argument. That is
> the case even though I am using the default viewport, not a QGLWidget,
> to render.
>
> How can a child of QGraphicsItem find the QGraphicsView on which it is
> being viewed?
>
> Sherif
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list