From 45862beccd07de14d66d249fc368057bb0a33fd4 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Wed, 9 Nov 2011 10:23:50 -0600 Subject: Bunches of object stuff relating to groups --- src/ui.py | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'src/ui.py') 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 + -- cgit v1.2.3