Select and set as current item last item

This commit is contained in:
ChrisDal 2017-04-25 09:44:01 +02:00 committed by GitHub
parent 2708b4bbb8
commit f0f1bb2b5a

View File

@ -886,7 +886,12 @@ class MainWindow(QMainWindow, WindowMixin):
self.loadPascalXMLByFilename(xmlPath)
self.setWindowTitle(__appname__ + ' ' + filePath)
# Default : select last item if there is at least one item
if self.labelList.count():
self.labelList.setCurrentItem(self.labelList.item(self.labelList.count()-1))
self.labelList.setItemSelected(self.labelList.item(self.labelList.count()-1), True)
self.canvas.setFocus(True)
return True
return False