diff options
Diffstat (limited to 'src/ui.py')
-rw-r--r-- | src/ui.py | 31 |
1 files changed, 6 insertions, 25 deletions
@@ -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 + |