# eric6.E5Gui.E5ZoomWidget

Module implementing a zoom widget for the status bar.

### Global Attributes

None

### Classes

E5ZoomWidget | Class implementing a zoom widget for the status bar.

### Functions

None

## E5ZoomWidget

Class implementing a zoom widget for the status bar.

### Signals

valueChanged(value)
  emitted to indicate the new zoom value (int)

### Derived from

QWidget, Ui_E5ZoomWidget

### Class Attributes

None

### Class Methods

None

### Methods

E5ZoomWidget | Constructor
__indexForValue | Private method to get the nearest index for a given value.
__setValueLabelWidth | Private slot to determine the width of the zoom value label.
__zoomIn | Private slot to zoom in one step.
__zoomOut | Private slot to zoom out one step.
__zoomReset | Private slot to reset the value.
_sliderValueChanged | Protected slot to handle changes of the slider value.
default | Public method to get the default zoom value.
isMapped | Public method to check for a mapped zoom widget.
isPercent | Public method to get the percent mode.
mapping | Public method to get the current mapping.
maximum | Public method to get the maximum value.
minimum | Public method to get the minimum value.
on_slider_sliderMoved | Private slot to handle changes of the zoom value.
pageStep | Public method to get the page step value.
setDefault | Public method to set the default zoom value.
setMapping | Public method to set a zoom level mapping.
setMaximum | Public method to set the maximum value.
setMinimum | Public method to set the minimum value.
setPageStep | Public method to set the page step value.
setPercent | Public method to set the percent mode of the widget.
setSingleStep | Public method to set the single step value.
setValue | Public slot to set the value.
singleStep | Public method to get the single step value.
value | Public method to get the current value.

### Static Methods

None

#### E5ZoomWidget (Constructor)

E5ZoomWidget(outPix, inPix, resetPix, parent=None)

Constructor

outPix
  pixmap for the zoom out button (QPixmap)
inPix
  pixmap for the zoom in button (QPixmap)
resetPix
  pixmap for the zoom reset button (QPixmap)
parent
  reference to the parent widget (QWidget)

#### E5ZoomWidget.__indexForValue

__indexForValue(value)

Private method to get the nearest index for a given value.

value
  value to get the index for (integer)

Returns:
  index into the mapping list or the unchanged value, if mapping is not set (integer)

#### E5ZoomWidget.__setValueLabelWidth

__setValueLabelWidth()

Private slot to determine the width of the zoom value label.

#### E5ZoomWidget.__zoomIn

__zoomIn()

Private slot to zoom in one step.

#### E5ZoomWidget.__zoomOut

__zoomOut()

Private slot to zoom out one step.

#### E5ZoomWidget.__zoomReset

__zoomReset()

Private slot to reset the value.

#### E5ZoomWidget._sliderValueChanged

_sliderValueChanged(value)

Protected slot to handle changes of the slider value.

value
  slider value (integer)

#### E5ZoomWidget.default

default()

Public method to get the default zoom value.

Returns:
  default zoom value (integer)

#### E5ZoomWidget.isMapped

isMapped()

Public method to check for a mapped zoom widget.

Returns:
  flag indicating a mapped zoom widget (boolean)

#### E5ZoomWidget.isPercent

isPercent()

Public method to get the percent mode.

Returns:
  flag indicating percent mode (boolean)

#### E5ZoomWidget.mapping

mapping()

Public method to get the current mapping.

Returns:
  tuple of the mapping and the default index (list of integer, integer)

#### E5ZoomWidget.maximum

maximum()

Public method to get the maximum value.

Returns:
  maximum value (integer)

#### E5ZoomWidget.minimum

minimum()

Public method to get the minimum value.

Returns:
  minimum value (integer)

#### E5ZoomWidget.on_slider_sliderMoved

on_slider_sliderMoved(value)

Private slot to handle changes of the zoom value.

value
  value of the slider (integer)

#### E5ZoomWidget.pageStep

pageStep()

Public method to get the page step value.

Returns:
  page step value (integer)

#### E5ZoomWidget.setDefault

setDefault(value)

Public method to set the default zoom value.

value
  default zoom value (integer)

#### E5ZoomWidget.setMapping

setMapping(mapping, default, percent=True)

Public method to set a zoom level mapping.

When zoom level mapping is activated, the slider covers values from 0 to the max. index of the mapping list. The default value is the value of the default zoom level. If percent is given, the zoom level is shown as a percent value.

mapping
  list of mapping values (list of integer)
default
  index of the default value (integer)
percent=
  flag indicating to show zoom value in percent (boolean)

#### E5ZoomWidget.setMaximum

setMaximum(maximum)

Public method to set the maximum value.

maximum
  new maximum value (integer)

#### E5ZoomWidget.setMinimum

setMinimum(minimum)

Public method to set the minimum value.

minimum
  new minimum value (integer)

#### E5ZoomWidget.setPageStep

setPageStep(value)

Public method to set the page step value.

value
  page step value (integer)

#### E5ZoomWidget.setPercent

setPercent(on)

Public method to set the percent mode of the widget.

on
  flag indicating percent mode (boolean)

#### E5ZoomWidget.setSingleStep

setSingleStep(value)

Public method to set the single step value.

value
  value for the single step (integer)

#### E5ZoomWidget.setValue

setValue(value)

Public slot to set the value.

value
  new zoom value (integer)

#### E5ZoomWidget.singleStep

singleStep()

Public method to get the single step value.

Returns:
  single step value (integer)

#### E5ZoomWidget.value

value()

Public method to get the current value.

Returns:
  current zoom value (integer)

Up