QScintilla/MiniEditor.py

changeset 1131
7781e396c903
parent 1112
8a7d1b9d18db
child 1197
59fa9eae9123
equal deleted inserted replaced
1130:3e9f0330f833 1131:7781e396c903
43 43
44 @param parent parent widget (QWidget) 44 @param parent parent widget (QWidget)
45 @param name name of this instance (string) 45 @param name name of this instance (string)
46 @param flags window flags 46 @param flags window flags
47 """ 47 """
48 QsciScintillaCompat.__init__(self, parent) 48 super().__init__(parent)
49 49
50 self.mw = parent 50 self.mw = parent
51 51
52 def getFileName(self): 52 def getFileName(self):
53 """ 53 """
73 except AttributeError: 73 except AttributeError:
74 pass 74 pass
75 75
76 self.setCursorFlashTime(QApplication.cursorFlashTime()) 76 self.setCursorFlashTime(QApplication.cursorFlashTime())
77 77
78 QsciScintillaCompat.focusInEvent(self, event) 78 super().focusInEvent(event)
79 79
80 def focusOutEvent(self, event): 80 def focusOutEvent(self, event):
81 """ 81 """
82 Public method called when the editor loses focus. 82 Public method called when the editor loses focus.
83 83
84 @param event the event object (QFocusEvent) 84 @param event the event object (QFocusEvent)
85 """ 85 """
86 self.mw.editorActGrp.setEnabled(False) 86 self.mw.editorActGrp.setEnabled(False)
87 self.setCaretWidth(0) 87 self.setCaretWidth(0)
88 88
89 QsciScintillaCompat.focusOutEvent(self, event) 89 super().focusOutEvent(event)
90 90
91 91
92 class MiniEditor(QMainWindow): 92 class MiniEditor(QMainWindow):
93 """ 93 """
94 Class implementing a minimalistic editor for simple editing tasks. 94 Class implementing a minimalistic editor for simple editing tasks.
104 @param filename name of the file to open (string) 104 @param filename name of the file to open (string)
105 @param filetype type of the source file (string) 105 @param filetype type of the source file (string)
106 @param parent reference to the parent widget (QWidget) 106 @param parent reference to the parent widget (QWidget)
107 @param name object name of the window (string) 107 @param name object name of the window (string)
108 """ 108 """
109 QMainWindow.__init__(self, parent) 109 super().__init__(parent)
110 if name is not None: 110 if name is not None:
111 self.setObjectName(name) 111 self.setObjectName(name)
112 self.setAttribute(Qt.WA_DeleteOnClose) 112 self.setAttribute(Qt.WA_DeleteOnClose)
113 self.setWindowIcon(UI.PixmapCache.getIcon("editor.png")) 113 self.setWindowIcon(UI.PixmapCache.getIcon("editor.png"))
114 114

eric ide

mercurial