src/eric7/Documentation/Source/eric7.Graphics.SvgDiagram.html

Sat, 26 Apr 2025 12:34:32 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Apr 2025 12:34:32 +0200
branch
eric7
changeset 11240
c48c615c04a3
parent 10784
521fd465b048
permissions
-rw-r--r--

MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.

<!DOCTYPE html>
<html><head>
<title>eric7.Graphics.SvgDiagram</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>eric7.Graphics.SvgDiagram</h1>
<p>
Module implementing a dialog showing a SVG graphic.
</p>

<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>

<h3>Classes</h3>
<table>
<tr>
<td><a href="#SvgDiagram">SvgDiagram</a></td>
<td>Class implementing a dialog showing a SVG graphic.</td>
</tr>
</table>

<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>

<hr />
<hr />
<a NAME="SvgDiagram" ID="SvgDiagram"></a>
<h2>SvgDiagram</h2>
<p>
    Class implementing a dialog showing a SVG graphic.
</p>

<h3>Derived from</h3>
EricMainWindow
<h3>Class Attributes</h3>
<table>
<tr><td>ZoomLevelDefault</td></tr>
<tr><td>ZoomLevels</td></tr>
</table>

<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>

<h3>Methods</h3>
<table>
<tr>
<td><a href="#SvgDiagram.__init__">SvgDiagram</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__adjustScrollBar">__adjustScrollBar</a></td>
<td>Private method to adjust a scrollbar by a certain factor.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__doZoom">__doZoom</a></td>
<td>Private method to set the zoom value in percent.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__initActions">__initActions</a></td>
<td>Private method to initialize the view actions.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__initContextMenu">__initContextMenu</a></td>
<td>Private method to initialize the context menu.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__initToolBars">__initToolBars</a></td>
<td>Private method to populate the toolbars with our actions.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__levelForZoom">__levelForZoom</a></td>
<td>Private method determining the zoom level index given a zoom factor.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__loadSvgFile">__loadSvgFile</a></td>
<td>Private method to load a given SVG file.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__print">__print</a></td>
<td>Private slot to the actual printing.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__printDiagram">__printDiagram</a></td>
<td>Private slot called to print the diagram.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__printPreviewDiagram">__printPreviewDiagram</a></td>
<td>Private slot called to show a print preview of the diagram.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__showContextMenu">__showContextMenu</a></td>
<td>Private slot to show the context menu of the listview.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__zoom">__zoom</a></td>
<td>Private method to get the current zoom factor in percent.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__zoomIn">__zoomIn</a></td>
<td>Private method to zoom into the SVG.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__zoomOut">__zoomOut</a></td>
<td>Private method to zoom out of the SVG.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.__zoomReset">__zoomReset</a></td>
<td>Private method to reset the zoom value.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.event">event</a></td>
<td>Public method handling events.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.gestureEvent">gestureEvent</a></td>
<td>Protected method handling gesture events.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.getDiagramName">getDiagramName</a></td>
<td>Public method to retrieve a name for the diagram.</td>
</tr>
<tr>
<td><a href="#SvgDiagram.wheelEvent">wheelEvent</a></td>
<td>Protected method to handle wheel events.</td>
</tr>
</table>

<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>


<a NAME="SvgDiagram.__init__" ID="SvgDiagram.__init__"></a>
<h4>SvgDiagram (Constructor)</h4>
<b>SvgDiagram</b>(<i>svgFile, parent=None, name=None</i>)
<p>
        Constructor
</p>

<dl>

<dt><i>svgFile</i> (str)</dt>
<dd>
filename of a SVG graphics file to show
</dd>
<dt><i>parent</i> (QWidget)</dt>
<dd>
parent widget of the view
</dd>
<dt><i>name</i> (str)</dt>
<dd>
name of the view widget
</dd>
</dl>
<a NAME="SvgDiagram.__adjustScrollBar" ID="SvgDiagram.__adjustScrollBar"></a>
<h4>SvgDiagram.__adjustScrollBar</h4>
<b>__adjustScrollBar</b>(<i>scrollBar, factor</i>)
<p>
        Private method to adjust a scrollbar by a certain factor.
</p>

<dl>

<dt><i>scrollBar</i> (QScrollBar)</dt>
<dd>
reference to the scrollbar object
</dd>
<dt><i>factor</i> (float)</dt>
<dd>
factor to adjust by
</dd>
</dl>
<a NAME="SvgDiagram.__doZoom" ID="SvgDiagram.__doZoom"></a>
<h4>SvgDiagram.__doZoom</h4>
<b>__doZoom</b>(<i>value</i>)
<p>
        Private method to set the zoom value in percent.
</p>

<dl>

<dt><i>value</i> (int)</dt>
<dd>
zoom value in percent
</dd>
</dl>
<a NAME="SvgDiagram.__initActions" ID="SvgDiagram.__initActions"></a>
<h4>SvgDiagram.__initActions</h4>
<b>__initActions</b>(<i></i>)
<p>
        Private method to initialize the view actions.
</p>

<a NAME="SvgDiagram.__initContextMenu" ID="SvgDiagram.__initContextMenu"></a>
<h4>SvgDiagram.__initContextMenu</h4>
<b>__initContextMenu</b>(<i></i>)
<p>
        Private method to initialize the context menu.
</p>

<a NAME="SvgDiagram.__initToolBars" ID="SvgDiagram.__initToolBars"></a>
<h4>SvgDiagram.__initToolBars</h4>
<b>__initToolBars</b>(<i></i>)
<p>
        Private method to populate the toolbars with our actions.
</p>

<a NAME="SvgDiagram.__levelForZoom" ID="SvgDiagram.__levelForZoom"></a>
<h4>SvgDiagram.__levelForZoom</h4>
<b>__levelForZoom</b>(<i>zoom</i>)
<p>
        Private method determining the zoom level index given a zoom factor.
</p>

<dl>

<dt><i>zoom</i> (int)</dt>
<dd>
zoom factor
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
index of zoom factor
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
int
</dd>
</dl>
<a NAME="SvgDiagram.__loadSvgFile" ID="SvgDiagram.__loadSvgFile"></a>
<h4>SvgDiagram.__loadSvgFile</h4>
<b>__loadSvgFile</b>(<i>svgFile</i>)
<p>
        Private method to load a given SVG file.
</p>

<dl>

<dt><i>svgFile</i> (str)</dt>
<dd>
file path of the SVG file
</dd>
</dl>
<a NAME="SvgDiagram.__print" ID="SvgDiagram.__print"></a>
<h4>SvgDiagram.__print</h4>
<b>__print</b>(<i>printer</i>)
<p>
        Private slot to the actual printing.
</p>

<dl>

<dt><i>printer</i> (QPrinter)</dt>
<dd>
reference to the printer object
</dd>
</dl>
<a NAME="SvgDiagram.__printDiagram" ID="SvgDiagram.__printDiagram"></a>
<h4>SvgDiagram.__printDiagram</h4>
<b>__printDiagram</b>(<i></i>)
<p>
        Private slot called to print the diagram.
</p>

<a NAME="SvgDiagram.__printPreviewDiagram" ID="SvgDiagram.__printPreviewDiagram"></a>
<h4>SvgDiagram.__printPreviewDiagram</h4>
<b>__printPreviewDiagram</b>(<i></i>)
<p>
        Private slot called to show a print preview of the diagram.
</p>

<a NAME="SvgDiagram.__showContextMenu" ID="SvgDiagram.__showContextMenu"></a>
<h4>SvgDiagram.__showContextMenu</h4>
<b>__showContextMenu</b>(<i>coord</i>)
<p>
        Private slot to show the context menu of the listview.
</p>

<dl>

<dt><i>coord</i> (QPoint)</dt>
<dd>
the position of the mouse pointer
</dd>
</dl>
<a NAME="SvgDiagram.__zoom" ID="SvgDiagram.__zoom"></a>
<h4>SvgDiagram.__zoom</h4>
<b>__zoom</b>(<i></i>)
<p>
        Private method to get the current zoom factor in percent.
</p>

<dl>
<dt>Return:</dt>
<dd>
current zoom factor in percent
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
int
</dd>
</dl>
<a NAME="SvgDiagram.__zoomIn" ID="SvgDiagram.__zoomIn"></a>
<h4>SvgDiagram.__zoomIn</h4>
<b>__zoomIn</b>(<i></i>)
<p>
        Private method to zoom into the SVG.
</p>

<a NAME="SvgDiagram.__zoomOut" ID="SvgDiagram.__zoomOut"></a>
<h4>SvgDiagram.__zoomOut</h4>
<b>__zoomOut</b>(<i></i>)
<p>
        Private method to zoom out of the SVG.
</p>

<a NAME="SvgDiagram.__zoomReset" ID="SvgDiagram.__zoomReset"></a>
<h4>SvgDiagram.__zoomReset</h4>
<b>__zoomReset</b>(<i></i>)
<p>
        Private method to reset the zoom value.
</p>

<a NAME="SvgDiagram.event" ID="SvgDiagram.event"></a>
<h4>SvgDiagram.event</h4>
<b>event</b>(<i>evt</i>)
<p>
        Public method handling events.
</p>

<dl>

<dt><i>evt</i> (QEvent)</dt>
<dd>
reference to the event
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating, if the event was handled
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="SvgDiagram.gestureEvent" ID="SvgDiagram.gestureEvent"></a>
<h4>SvgDiagram.gestureEvent</h4>
<b>gestureEvent</b>(<i>evt</i>)
<p>
        Protected method handling gesture events.
</p>

<dl>

<dt><i>evt</i> (QGestureEvent)</dt>
<dd>
reference to the gesture event
</dd>
</dl>
<a NAME="SvgDiagram.getDiagramName" ID="SvgDiagram.getDiagramName"></a>
<h4>SvgDiagram.getDiagramName</h4>
<b>getDiagramName</b>(<i></i>)
<p>
        Public method to retrieve a name for the diagram.
</p>

<dl>
<dt>Return:</dt>
<dd>
name for the diagram
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="SvgDiagram.wheelEvent" ID="SvgDiagram.wheelEvent"></a>
<h4>SvgDiagram.wheelEvent</h4>
<b>wheelEvent</b>(<i>evt</i>)
<p>
        Protected method to handle wheel events.
</p>

<dl>

<dt><i>evt</i> (QWheelEvent)</dt>
<dd>
reference to the wheel event
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial