Motivation: Arguably, the usual flow to take a screenshot is to simply press the screenshot button. When only a selection of the so taken screenshot is needed I found it not very intuitive to select a different capture mode and take another screenshot. Personally, I always went through the round trip of using an external image editor to select a smaller part of the screenshot. Beside taking a second screenshot is often an unnecessary step, in the worst case the screen that needed to be captured has changed, e.g. a video.
This patch allows users to select a rectangular section of a screenshot from the KSImageWidget. The selection can be exported as usual, i.e. drag and drop, copied to clipboard or saved.
KSImageWidget is now zoomable (ctrl + mouse wheel) and movable (ctrl + left button or middle button). This is useful to do exact selections. However, the magnifier from the rectangular capture mode is still available. To start a new selection region a new UI button has been added. Selection can be cancelled by clicking outside of the selection rect.
Implementation details: For the new selection mode the code from the QuickEditor widget is reused. This is done by first moving most code (mostly unchanged) from QuickEditor to a QGraphicsObject (for easier zooming, scaling, translating of the scene). This QGraphicsObject is then used in KSImageWidget as well in the original QuickEditor. For this to work some code for correct scaling of the UI elements was added. Furthermore, some parameters of the QuickEditor are now changeable programmatically, for example to disable unneeded help text.