ViewManager/ViewManager.py

branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2484
105d78ba97d4
child 2677
3d4277929fb3
equal deleted inserted replaced
2523:139f182b72f6 2525:8b507a9a2d40
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the viewmanager base class. 7 Module implementing the viewmanager base class.
8 """ 8 """
9
10 from __future__ import unicode_literals # __IGNORE_WARNING__
9 11
10 import os 12 import os
11 13
12 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, QRegExp, \ 14 from PyQt4.QtCore import QSignalMapper, QTimer, QFileInfo, pyqtSignal, QRegExp, \
13 QObject, Qt 15 QObject, Qt
68 @param evt key event (QKeyPressEvent) 70 @param evt key event (QKeyPressEvent)
69 """ 71 """
70 if evt.key() == Qt.Key_Escape: 72 if evt.key() == Qt.Key_Escape:
71 self.escPressed.emit() 73 self.escPressed.emit()
72 else: 74 else:
73 super().keyPressEvent(evt) # pass it on 75 super(QuickSearchLineEdit, self).keyPressEvent(evt) # pass it on
74 76
75 def focusInEvent(self, evt): 77 def focusInEvent(self, evt):
76 """ 78 """
77 Re-implemented to record the current editor widget. 79 Re-implemented to record the current editor widget.
78 80
79 @param evt focus event (QFocusEvent) 81 @param evt focus event (QFocusEvent)
80 """ 82 """
81 self.gotFocus.emit() 83 self.gotFocus.emit()
82 super().focusInEvent(evt) # pass it on 84 super(QuickSearchLineEdit, self).focusInEvent(evt) # pass it on
83 85
84 86
85 class ViewManager(QObject): 87 class ViewManager(QObject):
86 """ 88 """
87 Base class inherited by all specific viewmanager classes. 89 Base class inherited by all specific viewmanager classes.
130 132
131 def __init__(self): 133 def __init__(self):
132 """ 134 """
133 Constructor 135 Constructor
134 """ 136 """
135 super().__init__() 137 super(ViewManager, self).__init__()
136 138
137 # initialize the instance variables 139 # initialize the instance variables
138 self.editors = [] 140 self.editors = []
139 self.currentEditor = None 141 self.currentEditor = None
140 self.untitledCount = 0 142 self.untitledCount = 0

eric ide

mercurial