[Qt-interest] (QWidget *) arriving through QGraphicsItem::paint(...) is not the (QGraphicsView *) expected
Sherif Ghali
sherif.ghali.1 at gmail.com
Fri Jul 15 18:06:18 CEST 2011
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
More information about the Qt-interest-old
mailing list