summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui.py31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/ui.py b/src/ui.py
index a6115ed..bbbd569 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -77,7 +77,6 @@ class KPObjectSelector(QtGui.QListView):
self.setResizeMode(QtGui.QListView.Adjust)
self.setWrapping(True)
- # self.setItemDelegate(KPObjectSelector.ObjectItemDelegate())
# Borrowed the signals and junk from Reggie, figure we'll need em'
self.clicked.connect(self.handleObjReplace)
@@ -115,29 +114,6 @@ class KPObjectSelector(QtGui.QListView):
objReplaced = QtCore.pyqtSignal(int)
- class KPGroupItemDelegate(QtGui.QAbstractItemDelegate):
- """Handles tileset groups, objects and their rendering"""
-
- def __init__(self):
- """Initialises the delegate"""
- QtGui.QAbstractItemDelegate.__init__(self)
-
- def paint(self, painter, option, index):
- """Paints an object"""
- if option.state & QtGui.QStyle.State_Selected:
- painter.fillRect(option.rect, option.palette.highlight())
-
- p = index.model().data(index, QtCore.Qt.DecorationRole)
- painter.drawPixmap(option.rect.x()+2, option.rect.y()+2, p)
- #painter.drawText(option.rect, str(index.row()))
-
- def sizeHint(self, option, index):
- """Returns the size for the object"""
- p = index.model().data(index, QtCore.Qt.UserRole)
- return p
-
-
-
@@ -180,9 +156,14 @@ class KPMainWindow(QtGui.QMainWindow):
self.addDockWidget(Qt.RightDockWidgetArea, self.layerListDock)
self.addDockWidget(Qt.RightDockWidgetArea, self.objectSelectorDock)
+
@QtCore.pyqtSlot()
def updateObjectSelector(self):
- pass
+ tileset = KPTileset.loadFromArc('/Users/Tempus/Dropbox/NEWERsmbw/Test3.arc')
+ self.objectSelector.setModel(tileset.getModel())
+
+ tileset.getModel().view = self.objectSelector
+