From e8fecb825f98cb8167ca2f803c5e720beca940c6 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 11 Nov 2011 15:51:33 +0100 Subject: fixed/improved KPObjectSelector signals --- src/ui.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ui.py b/src/ui.py index cc2aa0a..d2ac143 100644 --- a/src/ui.py +++ b/src/ui.py @@ -178,21 +178,21 @@ class KPObjectSelector(QtGui.QWidget): def currentChanged(self, current, previous): """Throws a signal emitting the current object when changed""" i = current.row() - object = self.model.groupItem().getItem(i) + object, depth = self.model.groupItem().getItem(i) - self.objChanged.emit(object) + self.objChanged.emit(i, object) def handleObjReplace(self, index): """Throws a signal when the selected object is used as a replacement""" if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.AltModifier: i = current.row() - object = self.model.groupItem().getItem(i) + object, depth = self.model.groupItem().getItem(i) - self.objReplaced.emit(object) + self.objReplaced.emit(i, object) - objChanged = QtCore.pyqtSignal(int) - objReplaced = QtCore.pyqtSignal(KPTileObject) + objChanged = QtCore.pyqtSignal(int, KPTileObject) + objReplaced = QtCore.pyqtSignal(int, KPTileObject) @@ -205,11 +205,10 @@ class KPMainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) - self.editor = KPEditorWidget() - self.setCentralWidget(self.editor) - self.scene = KPMapScene() - self.editor.setScene(self.scene) + + self.editor = KPEditorWidget(self.scene) + self.setCentralWidget(self.editor) self.setupMenuBar() -- cgit v1.2.3