[Qt-interest] QGraphicsView and perspective
John Clayton
johnclayton72 at gmail.com
Sun May 9 11:04:06 CEST 2010
Hi All,
Two questions, the context for both is:
- Qt 4.6.2
- Mac 10.6.3
(1) QGraphcisView & perspective
Is there a recommended way to change the perspective value of a QGraphicsView? I've got a single QGraphicsPixmapItem in one simple QWidget based view, and I am applying a rotation to it. The Mac/Cocoa based version of this that is using pure opengl, looks like this:
I don't see any explicit methods to set the perspective transformation on the view itself, and when I tried to override this by setting my own derived QGLWidget that uses its own MODELVIEW and PROJECTION matrices, that had no effect either (which upon more reflection makes sense).
(2) Antialiasing with an OpenGL QGraphicsView
My QGraphicsView based pixmap appears very very pixelated, is there a way to improve this situation? I've tried turning on all the high quality rendering options I can think of on the painter and on the view, e.g. on the graphics view:
_ui->graphicsView->setRenderHints(QPainter::HighQualityAntialiasing |
QPainter::Antialiasing |
QPainter::TextAntialiasing |
QPainter::SmoothPixmapTransform);
and when drawing the item itself:
void GraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setRenderHint(QPainter::HighQualityAntialiasing, true);
painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
... // call super
Mac/Cocoa version, anti-aliased, looking yummy:
http://idisk.me.com/john_clayton/Public/Pictures/Skitch/FileWave/mac-opengl-version-20100509-110021.png
Qt's OpenGL based QGraphicsView version - not antialiased - thus not so yummy:
http://idisk.me.com/john_clayton/Public/Pictures/Skitch/FileWave/mac-qt-version-20100509-110318.png
Thanks
--
John Clayton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100509/c7537b2c/attachment.html
More information about the Qt-interest-old
mailing list