test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
FWCore
GuiBrowsers
python
Vispa
Gui
ZoomableWidget.py
Go to the documentation of this file.
1
import
logging
2
import
os.path
3
4
from
PyQt4.QtCore
import
*
5
from
PyQt4.QtGui
import
*
6
7
from
Vispa.Gui.Zoomable
import
Zoomable
8
from
Vispa.Share.ImageExporter
import
ImageExporter
9
10
class
ZoomableWidget
(QWidget,
Zoomable
):
11
12
def
__init__
(self, parent=None):
13
""" Constructor
14
"""
15
QWidget.__init__(self, parent)
16
Zoomable.__init__(self)
17
self.
_imageExporter
=
None
18
19
if
isinstance(self.parent(), ZoomableWidget):
20
self.
setZoom
(self.parent().
zoom
())
21
22
def
setZoom
(self, zoom):
23
""" Sets zoom of this widget and of it's children.
24
"""
25
Zoomable.setZoom(self, zoom)
26
27
for
child
in
self.children():
28
if
isinstance(child, Zoomable):
29
child.setZoom(zoom)
30
self.update()
31
32
def
exportImage
(self, filename=None):
33
if
not
self.
_imageExporter
:
34
self.
_imageExporter
=
ImageExporter
(self)
35
36
if
not
filename:
37
self._imageExporter.exportImageDialog(self)
38
else
:
39
self._imageExporter.exportImage(self, filename)
Vispa.Gui.Zoomable.Zoomable.setZoom
def setZoom
Definition:
Zoomable.py:8
Vispa.Share.ImageExporter.ImageExporter
Definition:
ImageExporter.py:7
Vispa.Gui.Zoomable.Zoomable
Definition:
Zoomable.py:1
Vispa.Gui.ZoomableWidget.ZoomableWidget
Definition:
ZoomableWidget.py:10
QtCore
Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom
def setZoom
Definition:
ZoomableWidget.py:22
Vispa.Share.ImageExporter
Definition:
ImageExporter.py:1
Vispa.Gui.Zoomable.Zoomable.zoom
def zoom
Definition:
Zoomable.py:14
Vispa.Gui.ZoomableWidget.ZoomableWidget.exportImage
def exportImage
Definition:
ZoomableWidget.py:32
Vispa.Gui.ZoomableWidget.ZoomableWidget._imageExporter
_imageExporter
Definition:
ZoomableWidget.py:17
Vispa.Gui.ZoomableWidget.ZoomableWidget.__init__
def __init__
Definition:
ZoomableWidget.py:12
QtGui
Vispa.Gui.Zoomable
Definition:
Zoomable.py:1
Generated for CMSSW Reference Manual by
1.8.5