[Qt-interest] QGraphicsView or Qwidget

Samuel Rødal samuel.rodal at nokia.com
Fri Feb 26 12:21:22 CET 2010


ext Parta wrote:
> Hi
> 
> I am going to write a media Player for a embedded system. The system
> doesn't have support for OGL or floating point in hardware.
> Now I am confused what should I use QWidget or QGraphicsView
> framework. I am inclined to implement it as a QGraphicsView Item.
> It seems to give more control over look and feel of the thing but will
> take a little more time than using standard QWidgets like sliderbar.
> Though I can embed anything into QGV with proxywidget. But still I
> dont like the idea of making it a mixup of graphicsitems and QWigets.
> 
> One more thing that is giving me hard time is:
> 
> When I animate a item(item has many children), for every frame the
> scene seems to call all the children paint functions. That kill frame
> rates on the modest
> hardware that I have. I was thinking of caching the whole frame(only
> the bounding area of the parent) when the first frame is drawn and
> then animate that pixmap for the
> animation because during animation the children don't change how they
> look. they remain the same throughout the animation. this works but
> this approach is a little ugly in my view.
> Is there a cleaner, standard way in which I can achieve something like
> that using Qt.
> 
> Any thoughts are appreciated.
> 
> --
> Regards,
> Parta

Graphics items can be cached as pixmaps by using 
QGraphicsItem::setCacheMode(QGraphicsItem::ItemCoordinateCache);

or DeviceCoordinateCache if your item is heavily scaled.

--
Samuel




More information about the Qt-interest-old mailing list