Plugins/ViewManagerPlugins/Listspace/Listspace.py

changeset 3591
2f2a4a76dd22
parent 3484
645c12de6b0c
child 3621
15f23ed3f216
equal deleted inserted replaced
3590:5280e37405b8 3591:2f2a4a76dd22
37 37
38 self.editors = [] 38 self.editors = []
39 39
40 def addWidget(self, assembly): 40 def addWidget(self, assembly):
41 """ 41 """
42 Overwritten method to add a new widget. 42 Public method to add a new widget.
43 43
44 @param assembly editor assembly object to be added 44 @param assembly editor assembly object to be added
45 (QScintilla.EditorAssembly.EditorAssembly) 45 (QScintilla.EditorAssembly.EditorAssembly)
46 """ 46 """
47 editor = assembly.getEditor() 47 editor = assembly.getEditor()
49 if not editor in self.editors: 49 if not editor in self.editors:
50 self.editors.append(editor) 50 self.editors.append(editor)
51 51
52 def removeWidget(self, widget): 52 def removeWidget(self, widget):
53 """ 53 """
54 Overwritten method to remove a widget. 54 Public method to remove a widget.
55 55
56 @param widget widget to be removed (QWidget) 56 @param widget widget to be removed (QWidget)
57 """ 57 """
58 if isinstance(widget, QScintilla.Editor.Editor): 58 if isinstance(widget, QScintilla.Editor.Editor):
59 self.editors.remove(widget) 59 self.editors.remove(widget)
71 widget = widget.getEditor() 71 widget = widget.getEditor()
72 return widget 72 return widget
73 73
74 def setCurrentWidget(self, widget): 74 def setCurrentWidget(self, widget):
75 """ 75 """
76 Overwritten method to set the current widget. 76 Public method to set the current widget.
77 77
78 @param widget widget to be made current (QWidget) 78 @param widget widget to be made current (QWidget)
79 """ 79 """
80 if isinstance(widget, QScintilla.Editor.Editor): 80 if isinstance(widget, QScintilla.Editor.Editor):
81 self.editors.remove(widget) 81 self.editors.remove(widget)
83 widget = widget.parent() 83 widget = widget.parent()
84 super(StackedWidget, self).setCurrentWidget(widget) 84 super(StackedWidget, self).setCurrentWidget(widget)
85 85
86 def setCurrentIndex(self, index): 86 def setCurrentIndex(self, index):
87 """ 87 """
88 Overwritten method to set the current widget by its index. 88 Public method to set the current widget by its index.
89 89
90 @param index index of widget to be made current (integer) 90 @param index index of widget to be made current (integer)
91 """ 91 """
92 widget = self.widget(index) 92 widget = self.widget(index)
93 if widget is not None: 93 if widget is not None:
494 """ 494 """
495 pass 495 pass
496 496
497 def setEditorName(self, editor, newName): 497 def setEditorName(self, editor, newName):
498 """ 498 """
499 Change the displayed name of the editor. 499 Public method to change the displayed name of the editor.
500 500
501 @param editor editor window to be changed 501 @param editor editor window to be changed
502 @param newName new name to be shown (string) 502 @param newName new name to be shown (string)
503 """ 503 """
504 if newName: 504 if newName:
768 cindex = self.editors.index(editor) 768 cindex = self.editors.index(editor)
769 self.viewlist.setCurrentRow(cindex) 769 self.viewlist.setCurrentRow(cindex)
770 770
771 def eventFilter(self, watched, event): 771 def eventFilter(self, watched, event):
772 """ 772 """
773 Method called to filter the event queue. 773 Public method called to filter the event queue.
774 774
775 @param watched the QObject being watched 775 @param watched the QObject being watched
776 @param event the event that occurred 776 @param event the event that occurred
777 @return flag indicating, if we handled the event 777 @return flag indicating, if we handled the event
778 """ 778 """

eric ide

mercurial