[Qt-interest] How to render QGraphicsItem with all childrens to pixmap?
z
zoomer.gm at gmail.com
Fri Mar 12 21:13:05 CET 2010
So far i found only two ways to do it:
1) Manually iterate through children, calling their paint() on specified
painter
- This will require correct positioning of childrens and clipping. So it
seems that i reinventing things, already perfomed by Qt internally
2) Use QGraphicsScene::render()
- This will require the item being shown on the scene, and not covered by
other items. It is pretty hard to meet both requirements.
Neither of the those methods suitable for me because:
1) I use PyQt, and doing it manually may cost some perfomance. It will be
way better to rely on C++ for such tasks (i want to capture item with more
than few thousands childrens)
2) Items i want to capture to Pixmap are generally not shown on the scene -
they are hidden, waiting for me capturing them, show some animation with
this pixmap (i can't perform animation on item itself because of more than
9000 child items slows it the hell down)
So the question is, can i capture such heavyweight QGraphicsItem with all
it's children to QPixmap in some graceful way? Graphics view framework
already does it every time i show this item on the view, so can i reuse,
what it does?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100312/bb4694b2/attachment.html
More information about the Qt-interest-old
mailing list