[PyQt] Resizable rectangle/circle/polygon

tacyd franco.cut84 at live.com
Sat Apr 5 03:40:55 BST 2014


Hello all,
I'm a beginner in Python 3.3 and PyQt5 switching from long use of Matlab and
C#.
I am trying to develop a light GUI that allows user to load scientific data
and select  a region of it.
I successfully managed to import scientific images and plot them in PyQT5
using Matplotlib backends for it. 
I obtain a 2D plot ( imshow() or hist2d() ) and would like to allow the user
to choose a shape and select a region.

In short, I would like to know how to make multiple selectors that:
- are resizable on the fly
- remain visible ( can set a color for it ) 
- allow different shapes ( circle, rectangle, generic polygon) ( example: on
same image one square, one circle one random polygon)
- allow for overlap without issues

I did extensive research on the topic but did not find a satisfactory
example. I might be using the wrong wording. For any matlab user I'm seeking
the equivalent of imrect or imcircle or impoly for PyQT5.  (PyQt4 examples
are fine, I do understand the difference between 4 and 5) 

My understanding is I could simply modify the Matplotlib.widget
RectangleSelector, however being on Qt already it would seem ( to me ) more
"natural" to implement a QtWidget similar to QRubberband. 

Could anyone suggest what would be the most efficient way to do it?

I do thank you in advance for all your help! :)

Franco



--
View this message in context: http://python.6.x6.nabble.com/Resizable-rectangle-circle-polygon-tp5052650.html
Sent from the PyQt mailing list archive at Nabble.com.


More information about the PyQt mailing list