# class KPixmapRegionSelectorWidget

###

Module | kdeui
Namespace |
Class | KPixmapRegionSelectorWidget
Inherits | QWidget

KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap.

NOTE: There are two copies of this .h and the .cpp file, with subtle differences. One copy is in kdelibs/kdeui, and the other copy is in kdepim/libkdepim This is because kdepim has to remain backwards compatible. Any changes to either file should be made to the other.

Author Antonio Larrosa <larrosa@kde.org>

### enums

- RotateDirection { Rotate90, Rotate180, Rotate270 }

enum details

### methods

- KPixmapRegionSelectorWidget (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Constructor for a KPixmapRegionSelectorWidget.

- KPixmapRegionSelectorWidget (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KPixmapRegionSelectorWidget |

- KPixmapRegionSelectorWidget (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- createPopupMenu ( )

  returns KMenu

  Creates a KMenu with the menu that appears when clicking with the right button on the label

- pixmap ( )

  returns QPixmap

  Returns the original whole pixmap that we're using in this widget as the pixmap the user is selecting a region from.

- resetSelection ( )

  returns Nothing

  Resets the selection to use the whole image

- rotate (direction)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  direction | KPixmapRegionSelectorWidget.RotateDirection |

  Rotates the image as specified by the direction parameter, also tries to rotate the selected region so that it doesn't change, as long as the forced aspect ratio setting is respected, in other case, the selected region is reset.

- rotateClockwise ( )

  returns Nothing

  Rotates the current image 90º clockwise

- rotateCounterclockwise ( )

  returns Nothing

  Rotates the current image 90º counterclockwise

- selectedImage ( )

  returns QImage

  Returns a QImage object with just the region the user selected from the image

- selectedRegion ( )

  returns QRect

  Returns the selected region ( in zoomed pixmap coordinates )

- setFreeSelectionAspectRatio ( )

  returns Nothing

  Allows the user to do a selection which has any aspect ratio. This is the default.

  See also setSelectionAspectRatio()

- setMaximumWidgetSize (width, height)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  width | int |
  height | int |

  Sets the maximum size for the widget. If the image is larger than this (either horizontally or vertically), it's scaled to adjust to the maximum size (preserving the aspect ratio)

- setPixmap (pixmap)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pixmap | QPixmap |

  Sets the pixmap which will be shown for the user to select a region from.

  pixmap - The pixmap. Must be non-null.

- setSelectedRegion (rect)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  rect | QRect |

  Sets the selected region to be rect (in zoomed pixmap coordinates)

- setSelectionAspectRatio (width, height)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  width | int |
  height | int |

  Sets the aspect ration that the selected subimage should have. The way to select it, is specifying an example valid width and height.

  See also setFreeSelectionAspectRatio()

- unzoomedSelectedRegion ( )

  returns QRect

  Returns the selected region ( in unzoomed, original pixmap coordinates )

### enums - detail

- RotateDirection { Rotate90, Rotate180, Rotate270 }

  This enum provides a rotation direction.

  See also KPixmapRegionSelectorWidget.rotate()

  | Rotate90 | - | - |
  | Rotate180 | - | - |
  | Rotate270 | - | - |