- # TODO: do a dynamic size for widget
- def sizeHint(self):
- s = QtCore.QSize()
- s.setHeight(super(BufferListWidget,self).sizeHint().height())
- s.setWidth(self.sizeHintForColumn(0))
- return s
+ def addItem(self, *args):
+ """Re-implement addItem to set dynamic size after add."""
+ apply(QtGui.QListWidget.addItem, (self,) + args)
+ self.setMaximumWidth(self.sizeHintForColumn(0) + 4)
+
+
+class BufferListWidget(GenericListWidget):
+ """Widget with list of buffers."""
+
+ def __init__(self, *args):
+ apply(GenericListWidget.__init__, (self,) + args)