def _checkSize ( self ) : if self . _item_height is not None : sz = min ( self . _max_height_items , self . count ( ) ) * self . _item_height + 5 sz = max ( sz , 20 ) self . setMinimumSize ( 0 , sz ) self . setMaximumSize ( 1000000 , sz ) self . resize ( self . width ( ) , sz )
python widget maximum dimensions
Automatically resizes widget to display at most max_height_items items
def _checkSize(self):
        """Automatically resizes widget to display at most max_height_items items"""
        if self._item_height is not None:
            sz = min(self._max_height_items, self.count()) * self._item_height + 5
            sz = max(sz, 20)
            self.setMinimumSize(0, sz)
            self.setMaximumSize(1000000, sz)
            self.resize(self.width(), sz)