Pythonclass Item(QtGui.QListWidgetItem): def __init__(self, widget, parent=None): QtGui.QListWidgetItem.__init__(self, parent) self.widget = widget self.setSizeHint(QtCore.QSize(0, 17)) self.widget.ui.pushButton.clicked.connect(self.resized) def resized(self): self.setSizeHint(self.widget.sizeHint())
C++ (Qt)class Item : public QListWidgetItem, public QObject{ Q_OBJECT...};