[PyQt] PyQt Custom Widget

dlka16 jeyanhere at gmail.com
Thu Oct 6 16:01:55 BST 2016


I created a custom widget (in this case MainWidget) and added it to a list
widget. The custom widget does not shrink to fit in the list widget.

    item = QtGui.QListWidgetItem(self.ui.listWidget)
    item_widget = MainWidget()
    item.setSizeHint(item_widget.sizeHint())
    self.ui.listWidget.addItem(item)
    self.ui.listWidget.setItemWidget(item,item_widget)

can somebody help me in fixing this?



--
View this message in context: http://python.6.x6.nabble.com/PyQt-Custom-Widget-tp5201207.html
Sent from the PyQt mailing list archive at Nabble.com.


More information about the PyQt mailing list