[Qt-interest] Howto "fix" a scene into the top left corner of a QGraphicsView?

Abdelrazak Younes younes.abdel at gmail.com
Tue Jan 25 09:53:44 CET 2011


Hello,

I want the top-left corner od the scene to always be visible but I don't 
know how to do that. I've tried:

QGraphicsView * view;
...
view->setAlignment(Qt::AlignLeft | Qt::AlignTop);

But that's not enough, the first visible x is at the first drawn item... 
(around 150).
I've also tried this:
view->ensureVisible(1, 1, 1, 1);

But that doesn't do it either... there must be something I don't 
understand in this graphicsview stuff...

Help, please?

Abdel.





More information about the Qt-interest-old mailing list