src/eric7/Testing/TestingWidget.py

branch
eric7-maintenance
changeset 11194
1bfb44d3bedc
parent 11155
e1843b6efa73
parent 11181
52e30cc024aa
equal deleted inserted replaced
11156:c1ba5c1e4ed1 11194:1bfb44d3bedc
1362 @param linenumber line number to place the cursor at (defaults to 1) 1362 @param linenumber line number to place the cursor at (defaults to 1)
1363 @type int (optional) 1363 @type int (optional)
1364 """ 1364 """
1365 from eric7.QScintilla.MiniEditor import MiniEditor 1365 from eric7.QScintilla.MiniEditor import MiniEditor
1366 1366
1367 editor = MiniEditor(filename, "Python3", self) 1367 editor = MiniEditor(filename, "Python3")
1368 editor.closing.connect(lambda: self.__editorClosing(editor))
1368 editor.gotoLine(linenumber) 1369 editor.gotoLine(linenumber)
1369 editor.show() 1370 editor.show()
1370 1371
1371 self.__editors.append(editor) 1372 self.__editors.append(editor)
1372 1373
1374 def __editorClosing(self, editor):
1375 """
1376 Private method called, when an editor is closing.
1377
1378 @param editor reference to the closing editor
1379 @type MiniEditor
1380 """
1381 with contextlib.suppress(ValueError):
1382 self.__editors.remove(editor)
1383 del editor
1384
1373 def closeEvent(self, event): 1385 def closeEvent(self, event):
1374 """ 1386 """
1375 Protected method to handle the close event. 1387 Protected method to handle the close event.
1376 1388
1377 @param event close event 1389 @param event close event
1378 @type QCloseEvent 1390 @type QCloseEvent
1379 """ 1391 """
1380 event.accept()
1381
1382 for editor in self.__editors: 1392 for editor in self.__editors:
1383 with contextlib.suppress(RuntimeError): 1393 with contextlib.suppress(RuntimeError):
1384 editor.close() 1394 editor.close()
1395
1396 event.accept()
1385 1397
1386 @pyqtSlot(str) 1398 @pyqtSlot(str)
1387 def on_statusFilterComboBox_currentTextChanged(self, status): 1399 def on_statusFilterComboBox_currentTextChanged(self, status):
1388 """ 1400 """
1389 Private slot handling the selection of a status for items to be shown. 1401 Private slot handling the selection of a status for items to be shown.

eric ide

mercurial