QGraphicsScene

57 views
Skip to first unread message

illunara

unread,
Jan 25, 2013, 2:51:22 PM1/25/13
to python_in...@googlegroups.com
Hello everybody
I have some questions about QGraphicsScene:
- About the setResizeAnchor, how can set it to opposite with the resize's direction? There is a WNorthWestGravity in Qt but i'm not sure if it right or not.

- Except for QGraphicsItem, can we add anything else to it?

- Is there any event using the middle mouse button to move the area freely, like how we do with FireFox?

Thanks :D

Justin Israel

unread,
Jan 26, 2013, 8:36:23 PM1/26/13
to python_in...@googlegroups.com


On Jan 26, 2013 8:51 AM, "illunara" <cb.il...@gmail.com> wrote:
>
> Hello everybody
> I have some questions about QGraphicsScene:
> - About the setResizeAnchor, how can set it to opposite with the resize's direction? There is a WNorthWestGravity in Qt but i'm not sure if it right or not.
>
> - Except for QGraphicsItem, can we add anything else to it?

What would you like to add? QGraphicsItem is the base class of the other specific typed like rect, line, and text.
You are able to subclass your own item and compose other items or implement your own paint method.
There is also the ability to add normal QWidgets through a proxy, but that is a slow approach and should be avoided.

>
> - Is there any event using the middle mouse button to move the area freely, like how we do with FireFox?

QGraphicsItem receives a mouse press event:
http://doc.qt.digia.com/qt/qgraphicsitem.html#mousePressEvent
You are free to reimplement it and check for a middle mouse button. Then perform what you want.

>
> Thanks :D
>
> --
> You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
> To post to this group, send email to python_in...@googlegroups.com.
> To unsubscribe from this group, send email to python_inside_m...@googlegroups.com.
>
>

Tuan Nguyen

unread,
Jan 27, 2013, 1:19:44 AM1/27/13
to python_in...@googlegroups.com
But we don't have a built-in one, isn't it. Anyway, i try to do it like you said, but have some trouble with the scale,
I will attach the script file along, can you look it up for me please?

No matter where i set the transformationAnchor, the scale's behave is weird.
Maybe i was wrong when calculate the scale value?


To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
TestGraphicView
Reply all
Reply to author
Forward
0 new messages