eric7.Graphics.PixmapDiagram

Module implementing a dialog showing a pixmap.

Global Attributes

None

Classes

PixmapDiagram Class implementing a dialog showing a pixmap.

Functions

None


PixmapDiagram

Class implementing a dialog showing a pixmap.

Derived from

EricMainWindow

Class Attributes

ZoomLevelDefault
ZoomLevels

Class Methods

None

Methods

PixmapDiagram Constructor
__adjustScrollBar Private method to adjust a scrollbar by a certain factor.
__doZoom Private method to set the zoom value in percent.
__initActions Private method to initialize the view actions.
__initContextMenu Private method to initialize the context menu.
__initToolBars Private method to populate the toolbars with our actions.
__levelForZoom Private method determining the zoom level index given a zoom factor.
__print Private slot to the actual printing.
__printDiagram Private slot called to print the diagram.
__printPreviewDiagram Private slot called to show a print preview of the diagram.
__showContextMenu Private slot to show the context menu of the listview.
__showPixmap Private method to show a file.
__zoom Private method to get the current zoom factor in percent.
__zoomIn Private method to zoom into the pixmap.
__zoomOut Private method to zoom out of the pixmap.
__zoomReset Private method to reset the zoom value.
event Public method handling events.
gestureEvent Protected method handling gesture events.
getDiagramName Public method to retrieve a name for the diagram.
getStatus Public method to retrieve the status of the canvas.
wheelEvent Protected method to handle wheel events.

Static Methods

None

PixmapDiagram (Constructor)

PixmapDiagram(pixmap, parent=None, name=None)

Constructor

pixmap (str)
filename of a graphics file to show
parent (QWidget)
parent widget of the view
name (str)
name of the view widget

PixmapDiagram.__adjustScrollBar

__adjustScrollBar(scrollBar, factor)

Private method to adjust a scrollbar by a certain factor.

scrollBar (QScrollBar)
reference to the scrollbar object
factor (float)
factor to adjust by

PixmapDiagram.__doZoom

__doZoom(value)

Private method to set the zoom value in percent.

value (int)
zoom value in percent

PixmapDiagram.__initActions

__initActions()

Private method to initialize the view actions.

PixmapDiagram.__initContextMenu

__initContextMenu()

Private method to initialize the context menu.

PixmapDiagram.__initToolBars

__initToolBars()

Private method to populate the toolbars with our actions.

PixmapDiagram.__levelForZoom

__levelForZoom(zoom)

Private method determining the zoom level index given a zoom factor.

zoom (int)
zoom factor
Return:
index of zoom factor
Return Type:
int

PixmapDiagram.__print

__print(printer)

Private slot to the actual printing.

printer (QPrinter)
reference to the printer object

PixmapDiagram.__printDiagram

__printDiagram()

Private slot called to print the diagram.

PixmapDiagram.__printPreviewDiagram

__printPreviewDiagram()

Private slot called to show a print preview of the diagram.

PixmapDiagram.__showContextMenu

__showContextMenu(coord)

Private slot to show the context menu of the listview.

coord (QPoint)
the position of the mouse pointer

PixmapDiagram.__showPixmap

__showPixmap(filename)

Private method to show a file.

filename (str)
name of the file to be shown
Return:
flag indicating success
Return Type:
bool

PixmapDiagram.__zoom

__zoom()

Private method to get the current zoom factor in percent.

Return:
current zoom factor in percent
Return Type:
int

PixmapDiagram.__zoomIn

__zoomIn()

Private method to zoom into the pixmap.

PixmapDiagram.__zoomOut

__zoomOut()

Private method to zoom out of the pixmap.

PixmapDiagram.__zoomReset

__zoomReset()

Private method to reset the zoom value.

PixmapDiagram.event

event(evt)

Public method handling events.

evt (QEvent)
reference to the event
Return:
flag indicating, if the event was handled
Return Type:
bool

PixmapDiagram.gestureEvent

gestureEvent(evt)

Protected method handling gesture events.

evt (QGestureEvent)
reference to the gesture event

PixmapDiagram.getDiagramName

getDiagramName()

Public method to retrieve a name for the diagram.

Return:
name for the diagram
Return Type:
str

PixmapDiagram.getStatus

getStatus()

Public method to retrieve the status of the canvas.

Return:
flag indicating a successful pixmap loading
Return Type:
bool

PixmapDiagram.wheelEvent

wheelEvent(evt)

Protected method to handle wheel events.

evt (QWheelEvent)
reference to the wheel event
Up