10

I'm writing a small application in Python, and I wanted the user to be able to place, move, rotate, etc. different objects on a canvas. Is there any way to accomplish that without a ton of coding? I'm doing this in my free time, and I only have a limited experience in PyQt.

That's basically what any vector graphics editor does (ie. Inkscape, Corel Draw or Dr. Geo): they give the users handles to move, stretch and rotate objects. I was wondering if there's any widget or whatever that already provides the handles and the basic operations, so I only have to implement the program's reaction to those operations.

Since I'm planning on releasing this under a free license (if I ever get to the point of releasing) any open source license would be great.

Thanks!

3 Answers 3

4

Look at Qt Graphics View Framework, it is supported in PyQt4. Another option is to use OpenGL which will require more code but provide more flexibility and hardware acceleration (also supported in PyQt4).

Sign up to request clarification or add additional context in comments.

2 Comments

As far as I can see, the Qt Graphics View helps a lot (it provides the rendering and mouse events), but I'll need to make a custom Item class to get the translation, etc., and to draw the handles. It's not awfully hard, so if there's no better answer I guess I'll go with that one.
Both those links are dead.
3

One option is GooCanvas and the Python bindings for it. GooCanvas

Comments

1

Look at the library gaphas, it implements object resize/move/edit by default, so it is quick to start with.

1 Comment

Gaphas has poor documentation. Just very abstract concepts and API reference. No tutorial nor examples explained. No hello world. Also the API seems very ackward and anti intuititive. Really hard to grasp. On the other hand I havent found other similar library

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.