[PyQt] Use itemChange() in PyQt4

Pedro Paulo pedropaulobmjr at hotmail.com
Mon Dec 21 09:22:58 GMT 2015


Hello everybody, using QGraphics, I put a rectangle on an image and I'm trying to limit it to QGraphiscsScene area when I move it with the mouse, I followed what the Qt documentation says (http://doc.qt.io/qt-5/qgraphicsitem.html#itemChange), but when I run the code, it only limits the rectangle on the left and upper end of the scene, on the right and bottom end, he continues to exceed the boundaries of the scene when I move the rectangle, can anyone help me telling me how to limit the rectangle in all areas?The code is attached, just run it and test it to see the problem if I did not explain precisely, thank you. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151221/2bdef2bb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code.zip
Type: application/zip
Size: 69895 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151221/2bdef2bb/attachment-0001.zip>


More information about the PyQt mailing list