KDE 4.7 PyKDE API Reference

- KDE's Python API

# KPixmapRegionSelectorDialog Class Reference

`from PyKDE4.kdeui import *`

Inherits: KDialog → QDialog → QWidget → QObject

## Detailed Description

A dialog that uses a KPixmapRegionSelectorWidget to allow the user to select a region of an image. If you want to use special features like forcing the selected area to have a fixed aspect ratio, you can use

See also:
  pixmapRegionSelectorWidget() to get the pointer to the KPixmapRegionSelectorWidget object and set the desired options there.

There are some convenience methods that allow to easily show a dialog for the user to select a region of an image, and just care about the selected image.

"KDE Pixmap Region Selector Dialog"

Author:
  Antonio Larrosa <larrosa@kde.org>

## Methods
| __init__ (self, QWidget parent=0)
| __init__ (self, KPixmapRegionSelectorDialog a0)
| adjustRegionSelectorWidgetSizeToFitScreen (self)
KPixmapRegionSelectorWidget | pixmapRegionSelectorWidget (self)
## Static Methods
QImage | getSelectedImage (QPixmap pixmap, QWidget parent=0)
QImage | getSelectedImage (QPixmap pixmap, int aspectRatioWidth, int aspectRatioHeight, QWidget parent=0)
QRect | getSelectedRegion (QPixmap pixmap, QWidget parent=0)
QRect | getSelectedRegion (QPixmap pixmap, int aspectRatioWidth, int aspectRatioHeight, QWidget parent=0)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

The constructor of an empty KPixmapRegionSelectorDialog, you have to call later the setPixmap method of the KPixmapRegionSelectorWidget widget of the new object.

__init__ | ( | self, |
|  | KPixmapRegionSelectorDialog | a0
| ) |  |  |

adjustRegionSelectorWidgetSizeToFitScreen | ( |  | self ) |

Since:
  4.4.3 Adjusts the size of the KPixmapRegionSelectorWidget to not overflow the screen size

KPixmapRegionSelectorWidget pixmapRegionSelectorWidget | ( |  | self ) |

Returns:
  the KPixmapRegionSelectorWidget widget so that additional parameters can be set by using it.

## Static Method Documentation

QImage getSelectedImage | ( | QPixmap | pixmap,
|  | QWidget | parent=0
| ) |  |  |

Creates a modal dialog, lets the user to select a region of the pixmap with the same aspect ratio than aspectRatioWidth x aspectRatioHeight and returns when the dialog is closed.

Returns:
  the selected image, or an invalid image if the user pressed the Cancel button.

QImage getSelectedImage | ( | QPixmap | pixmap,
|  | int | aspectRatioWidth,
|  | int | aspectRatioHeight,
|  | QWidget | parent=0
| ) |  |  |

Creates a modal dialog, lets the user to select a region of the pixmap with the same aspect ratio than aspectRatioWidth x aspectRatioHeight and returns when the dialog is closed.

Returns:
  the selected image, or an invalid image if the user pressed the Cancel button.

QRect getSelectedRegion | ( | QPixmap | pixmap,
|  | QWidget | parent=0
| ) |  |  |

Creates a modal dialog, lets the user to select a region of the pixmap with the same aspect ratio than aspectRatioWidth x aspectRatioHeight and returns when the dialog is closed.

Returns:
  the selected rectangle, or an invalid rectangle if the user pressed the Cancel button.

QRect getSelectedRegion | ( | QPixmap | pixmap,
|  | int | aspectRatioWidth,
|  | int | aspectRatioHeight,
|  | QWidget | parent=0
| ) |  |  |

Creates a modal dialog, lets the user to select a region of the pixmap with the same aspect ratio than aspectRatioWidth x aspectRatioHeight and returns when the dialog is closed.

Returns:
  the selected rectangle, or an invalid rectangle if the user pressed the Cancel button.