Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
FWCore
GuiBrowsers
python
Vispa
Views
AbstractView.py
Go to the documentation of this file.
1
import
logging
2
3
from
PyQt4.QtCore
import
SIGNAL,Qt
4
from
PyQt4.QtGui
import
QWidget
5
6
from
Vispa.Share.ObjectHolder
import
ObjectHolder
7
8
class
AbstractView
(
ObjectHolder
):
9
""" Abstract class for views which show a list of objects using a data accessor.
10
11
A view handles the selection of objects and allows to restore selection after refreshing.
12
On selection of an object the signal "selected" shall be emitted.
13
"""
14
15
LABEL =
"&Abstract View"
16
17
def
__init__
(self):
18
ObjectHolder.__init__(self)
19
20
def
updateContent
(self):
21
""" Update content of view.
22
23
Return True if successful.
24
"""
25
return
True
26
27
def
select
(self, object):
28
""" Select an object in the view.
29
"""
30
pass
31
32
def
selection
(self):
33
""" Return the last selected object in the view.
34
"""
35
return
None
36
37
def
restoreSelection
(self):
38
""" Select the last selected object in the view.
39
"""
40
self.
select
(self.
selection
())
41
42
def
cancel
(self):
43
""" Stop all operations in view.
44
"""
45
pass
46
47
def
isBusy
(self):
48
""" Return is operations are ongoing in view.
49
"""
50
return
False
51
52
class
NoneView
(
AbstractView
, QWidget):
53
54
LABEL =
"&None View"
55
56
def
__init__
(self, parent=None):
57
QWidget.__init__(self)
58
AbstractView.__init__(self)
59
60
def
mousePressEvent
(self,event):
61
QWidget.mousePressEvent(self,event)
62
if
event.button()==Qt.RightButton:
63
self.emit(SIGNAL(
"mouseRightPressed"
), event.globalPos())
Vispa.Views.AbstractView.NoneView
Definition:
AbstractView.py:52
Vispa.Share.ObjectHolder.ObjectHolder
Definition:
ObjectHolder.py:3
Vispa.Views.AbstractView.AbstractView.restoreSelection
def restoreSelection
Definition:
AbstractView.py:37
Vispa.Views.AbstractView.AbstractView.__init__
def __init__
Definition:
AbstractView.py:17
Vispa.Views.AbstractView.AbstractView.cancel
def cancel
Definition:
AbstractView.py:42
Vispa.Views.AbstractView.NoneView.__init__
def __init__
Definition:
AbstractView.py:56
Vispa.Views.AbstractView.AbstractView
Definition:
AbstractView.py:8
QtCore
Vispa.Share.ObjectHolder
Definition:
ObjectHolder.py:1
Vispa.Views.AbstractView.AbstractView.isBusy
def isBusy
Definition:
AbstractView.py:47
Vispa.Views.AbstractView.NoneView.mousePressEvent
def mousePressEvent
Definition:
AbstractView.py:60
Vispa.Views.AbstractView.AbstractView.selection
def selection
Definition:
AbstractView.py:32
Vispa.Views.AbstractView.AbstractView.updateContent
def updateContent
Definition:
AbstractView.py:20
QtGui
Vispa.Views.AbstractView.AbstractView.select
def select
Definition:
AbstractView.py:27
Generated for CMSSW Reference Manual by
1.8.5