Back to Blog home

Perspective transformations on a QGraphicsView

Published on Thursday March 01, 2007 by Andreas Aardal Hanssen in Labs Qt Graphics Items Graphics View | Comments

I don't have much to say this time, just wanted to share a screenshot after I changed the 40000 Chips demo a bit. I replaced the single horizontal rotation-slider with three ones, each controlling one axis or rotation for the view. QTransform is really easy to use, and with some twiddling (thumb up, pointing finger straight and your index finger pointing to the left), you can get some pretty amazing effects.

QGraphicsView view(&scene);

QTransform transform;
transform.rotate(45, Qt::XAxis);
transform.rotate(22.5, Qt::YAxis);


Setting one on a QGraphicsView works well, but there are still some rough edges that'll get fixed pretty soon. Anyway, this is what it looks like (interaction works just as well).

Transform - small

Subscribe to Our Blog

Stay up to date with the latest marketing, sales and service tips and news.

The blog comment system has been migrated to a new platform. If you face any issues, please let us know via