summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-11-11 15:51:33 +0100
committerTreeki <treeki@gmail.com>2011-11-11 15:51:33 +0100
commite8fecb825f98cb8167ca2f803c5e720beca940c6 (patch)
tree7980e33665e6ca677ad5e768a4efafe225d92d7c
parent1b72bafda7b06ab4c0e2679819655d388097000e (diff)
downloadkoopatlas-e8fecb825f98cb8167ca2f803c5e720beca940c6.tar.gz
koopatlas-e8fecb825f98cb8167ca2f803c5e720beca940c6.zip
fixed/improved KPObjectSelector signals
-rw-r--r--src/ui.py19
1 files changed, 9 insertions, 10 deletions
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()