(self)
return QSizeF(width, height)
Return the natural size hint (preferred sh with no constraints).
Return the natural size hint (preferred sh with no constraints).
Return the natural size hint ( preferred sh with no constraints ) .
def __naturalsh(self) -> QSizeF:
        """Return the natural size hint (preferred sh with no constraints)."""
        fm = QFontMetrics(self.font())
        spacing = self.__spacing
        N = len(self.__items)
        width = self.__width_for_font(self.font())
        height = N * fm.height() + max(N - 1, 0) * spacing
        return QSizeF(width, height)
def __naturalsh ( self ) -> QSizeF : fm = QFontMetrics ( self . font ( ) ) spacing = self . __spacing N = len ( self . __items ) width = self . __width_for_font ( self . font ( ) ) height = N * fm . height ( ) + max ( N - 1 , 0 ) * spacing return QSizeF ( width , height )