diff options
author | Colin Noga <Tempus@Spectrum-Song.local> | 2011-11-09 10:23:50 -0600 |
---|---|---|
committer | Colin Noga <Tempus@Spectrum-Song.local> | 2011-11-09 10:23:50 -0600 |
commit | 45862beccd07de14d66d249fc368057bb0a33fd4 (patch) | |
tree | b76e29d91165629766cb99ccbaf5dd7d74127837 /src/ui.py | |
parent | 02a1d81d760525f515337d2109feba8887aa5edb (diff) | |
download | koopatlas-45862beccd07de14d66d249fc368057bb0a33fd4.tar.gz koopatlas-45862beccd07de14d66d249fc368057bb0a33fd4.zip |
Bunches of object stuff relating to groups
Diffstat (limited to '')
-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 + |