parameters: (self, s, font=None)
return_statement: return rect.width()
docstring: Return the logical width of the string if it were drawn \
      in the current font (defaults to self.font).
docstring_summary: Return the logical width of the string if it were drawn \
      in the current font (defaults to self.font).
docstring_tokens: Return the logical width of the string if it were drawn \ in the current font ( defaults to self . font ) .
function: def stringWidth(self, s, font=None):
      "Return the logical width of the string if it were drawn \
      in the current font (defaults to self.font)."
  
      if not font:
        font = self.defaultFont
  
      if font:
        self._adjustFont(font)
      t = QtGui.QGraphicsTextItem(s)
      t.setFont(self._font)
      rect = t.boundingRect()
      return rect.width()
function_tokens: def stringWidth ( self , s , font = None ) : if not font : font = self . defaultFont if font : self . _adjustFont ( font ) t = QtGui . QGraphicsTextItem ( s ) t . setFont ( self . _font ) rect = t . boundingRect ( ) return rect . width ( )