Graphics View improvements

We're in the process of closing up the features for 4.3, and I've had a little run-down of what's changed in Graphics View.

In general, you will notice that the graphics run faster, (especially for complex polygons,) collisions are absolutely precise, the rubberband looks 100x better... I think most of our Graphics View followers will be very pleased with the upcoming Qt 4.3.

When the first beta is released, it's nice if you as a Graphics View developer try out your Qt 4.2 app with 4.3, so that we can nail out any possible regressions (both behavior and speed) before the final version is out. So please, let us know :-).

Here are some of the new features:

  • QGraphicsView has some new properties.
    • viewportUpdateMode: Now you can fine-tune how the viewport reacts the changes in the scene.
    • rubberBandSelectionMode: For those who want to select items that are inside but don't intersect with the rubberband...
    • optimizationFlags: If you want faster graphics, away goes the safety net... ;-)
  • All flicker in rubberband mode is gone.
  • You can also transform the view with a QTransform; this works best for small scenes, though. But the effect of seeing your scene with perspective transformations is pretty cool.
  • QGraphicsItem has some new flags.
    • ItemClipsToShape: All item rendering is clipped to its own shape
    • ItemClipsChildrenToShape: Like widgets, the parent item clips all its descendents.
    • ItemIgnoresTransformations: The lovable item that just won't transform... well.

There's been some under-the-hood changes too. Where before, if you moved an item, it would always get continuously reindexed (for each mouse move event), now it goes into an intermediate state that keeps the item outside the index until you leave it for a while. When moving a lot of items together, this makes a huge difference. It also means you don't have to use NoIndex for scenes that combine animated and static items! It'll still be pretty fast.

Check out the chip demo, or run the Colliding Mice example in one window, and top/Task Manager in the other; it's faster in Qt 4.3 snapshots!

[no carrier] - /me waits for the first comment going "Hey, it's not fast at all!" ;-)

Blog Topics: