diff options
Diffstat (limited to '')
-rw-r--r-- | src/ui.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -773,7 +773,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(KPLayer) def handleSelectedLayerChanged(self, layer): - self.pathNodeList.tree.selectionModel().clearSelection() + sel = self.pathNodeList.tree.selectionModel() + if sel: + sel.clearSelection() self.scene.setCurrentLayer(layer) @@ -795,7 +797,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(KPLayer) def handleSelectedPathNodeLayerChanged(self, layer): - self.layerList.listView.selectionModel().clearSelection() + sel = self.layerList.listView.selectionModel() + if sel: + sel.clearSelection() self.scene.setCurrentLayer(layer) @@ -810,7 +814,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(int, KPTileObject) def handleSelectedObjectChanged(self, index, obj): - self.doodadSelector.listView.selectionModel().clearSelection() + sel = self.doodadSelector.listView.selectionModel() + if sel: + sel.clearSelection() self.editor.objectToPaint = obj self.editor.objectIDToPaint = index @@ -819,7 +825,9 @@ class KPMainWindow(QtGui.QMainWindow): @QtCore.pyqtSlot(object) def handleSelectedDoodadChanged(self, doodad): - self.objectSelector.listView.selectionModel().clearSelection() + sel = self.objectSelector.listView.selectionModel() + if sel: + sel.clearSelection() self.editor.doodadToPaint = doodad self.editor.typeToPaint = 'doodad' |