# eric7.Snapshot.SnapshotFreehandGrabber

Module implementing a grabber widget for a freehand snapshot region.

### Global Attributes

None

### Classes

SnapshotFreehandGrabber | Class implementing a grabber widget for a freehand snapshot region.

### Functions

drawPolygon | Module function to draw a polygon with the given parameters.

## SnapshotFreehandGrabber

Class implementing a grabber widget for a freehand snapshot region.

### Signals

grabbed(QPixmap)
  emitted after the region was grabbed

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

SnapshotFreehandGrabber | Constructor
__grabRegion | Private method to grab the selected region (i.e.
__initialize | Private slot to initialize the rest of the widget.
keyPressEvent | Protected method to handle key presses.
mouseDoubleClickEvent | Protected method to handle mouse double clicks.
mouseMoveEvent | Protected method to handle mouse movements.
mousePressEvent | Protected method to handle mouse button presses.
mouseReleaseEvent | Protected method to handle mouse button releases.
paintEvent | Protected method handling paint events.

### Static Methods

None

#### SnapshotFreehandGrabber (Constructor)

SnapshotFreehandGrabber()

Constructor

#### SnapshotFreehandGrabber.__grabRegion

__grabRegion()

Private method to grab the selected region (i.e. do the snapshot).

#### SnapshotFreehandGrabber.__initialize

__initialize()

Private slot to initialize the rest of the widget.

#### SnapshotFreehandGrabber.keyPressEvent

keyPressEvent(evt)

Protected method to handle key presses.

evt (QKeyEvent)
  key press event

#### SnapshotFreehandGrabber.mouseDoubleClickEvent

mouseDoubleClickEvent(evt)

Protected method to handle mouse double clicks.

evt (QMouseEvent)
  mouse double click event

#### SnapshotFreehandGrabber.mouseMoveEvent

mouseMoveEvent(evt)

Protected method to handle mouse movements.

evt (QMouseEvent)
  mouse move event

#### SnapshotFreehandGrabber.mousePressEvent

mousePressEvent(evt)

Protected method to handle mouse button presses.

evt (QMouseEvent)
  mouse press event

#### SnapshotFreehandGrabber.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method to handle mouse button releases.

evt (QMouseEvent)
  mouse release event

#### SnapshotFreehandGrabber.paintEvent

paintEvent(evt)

Protected method handling paint events.

evt (QPaintEvent)
  paint event

Up

## drawPolygon

drawPolygon(painter, polygon, outline, fill=None)

Module function to draw a polygon with the given parameters.

painter (QPainter)
  reference to the painter to be used
polygon (QPolygon)
  polygon to be drawn
outline (QColor)
  color of the outline
fill (QColor)
  fill color

Up