summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.py')
-rw-r--r--src/ui.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ui.py b/src/ui.py
index b785a69..a6d1516 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -201,16 +201,22 @@ class KPDoodadSelector(QtGui.QWidget):
def getDoodad(self, index):
"""Retrieves a doodad by index"""
+ index = QtCore.QVariant(index)
+ widget = self.doodadList
- for item in self.doodadList.items():
+ for i in xrange(widget.count()):
+ item = widget.item(i)
if item.data(32) == index:
return item
def getDoodadImage(self, index, width, height):
"""Retrieves a doodad pixmap by index"""
+ index = QtCore.QVariant(index)
+ widget = self.doodadList
- for item in self.doodadList.items():
+ for i in xrange(widget.count()):
+ item = widget.item(i)
if item.data(32) == index:
return item.icon().pixmap(width, height)
@@ -221,14 +227,14 @@ class KPDoodadSelector(QtGui.QWidget):
Image with doodad.icon().pixmap(doodad.icon().availableSizes()[0])
Index with doodad.data(32)"""
+ # TODO: FIX THIS
return self.doodadList.items()
@QtCore.pyqtSlot(QtGui.QListWidgetItem)
def handleRowChanged(self, current):
"""Throws a signal emitting the current object when changed"""
-
- self.objChanged.emit(current.data(32), current)
+ self.objChanged.emit(current.data(32).toPyObject(), current)