How to create movable and resizable image ?
-
Hi Friends.,
In my project i want to create user movable and resizable image in the QWidget, i used QLabel for moving the label ( drag ) and could not find how to set the QLabel in resizable.
I mean user will select the Image and increase and decrease the image width and height using mouse. I need help for done this resizable options. i could not find any solutions.Thanks in advance.
-
Hi, welcome to devnet.
Here's one way:
Override mousePressEvent. Inside check if the cursor is near the edge (use pos and rect for that). If it is then check which one and setOverrideCursor to something suitable. Remember the edge (or corner) that was pressed. Next, in the mouseMoveEvent setGeometry accordingly and handle mouseReleaseEvent to restoreOverrideCursor.