# eric6.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
  key press event (QKeyEvent)

#### SnapshotFreehandGrabber.mouseDoubleClickEvent

mouseDoubleClickEvent(evt)

Protected method to handle mouse double clicks.

evt
  mouse double click event (QMouseEvent)

#### SnapshotFreehandGrabber.mouseMoveEvent

mouseMoveEvent(evt)

Protected method to handle mouse movements.

evt
  mouse move event (QMouseEvent)

#### SnapshotFreehandGrabber.mousePressEvent

mousePressEvent(evt)

Protected method to handle mouse button presses.

evt
  mouse press event (QMouseEvent)

#### SnapshotFreehandGrabber.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method to handle mouse button releases.

evt
  mouse release event (QMouseEvent)

#### SnapshotFreehandGrabber.paintEvent

paintEvent(evt)

Protected method handling paint events.

evt
  paint event (QPaintEvent)

Up

## drawPolygon

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

Module function to draw a polygon with the given parameters.

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

Up