original_docstring: 
          Set the width of a hard tab.
  
          Qt does not appear to have the required methods. Indeed,
          https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt
          assumes that QTextEdit's have only a single font(!).
  
          This method probabably only works probably if the body text contains
          a single @language directive, and it may not work properly even then.
          
docstring: Set the width of a hard tab.
  Qt does not appear to have the required methods.
  
  This method probabably only works probably if the body text contains
  a single @language directive, and it may not work properly even then.
docstring_tokens: Set the width of a hard tab . Qt does not appear to have the required methods . This method probabably only works probably if the body text contains a single @language directive and it may not work properly even then .
code: def configure_hard_tab_width(self, font):
          """
          Set the width of a hard tab.
  
          Qt does not appear to have the required methods. Indeed,
          https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt
          assumes that QTextEdit's have only a single font(!).
  
          This method probabably only works probably if the body text contains
          a single @language directive, and it may not work properly even then.
          """
          c, widget = self.c, self.widget
          if isinstance(widget, QtWidgets.QTextEdit):
              # #1919: https://forum.qt.io/topic/99371/how-to-set-tab-stop-width-and-space-width
              fm = QtGui.QFontMetrics(font)
              try:  # fm.horizontalAdvance
                  width = fm.horizontalAdvance(' ') * abs(c.tab_width)
                  widget.setTabStopDistance(width)
              except Exception:
                  width = fm.width(' ') * abs(c.tab_width)
                  widget.setTabStopWidth(width)  # Obsolete.
          else:
              # To do: configure the QScintilla widget.
              pass
code_tokens: def configure_hard_tab_width ( self , font ) : c , widget = self . c , self . widget if isinstance ( widget , QtWidgets . QTextEdit ) : fm = QtGui . QFontMetrics ( font ) try : width = fm . horizontalAdvance ( ' ' ) * abs ( c . tab_width ) widget . setTabStopDistance ( width ) except Exception : width = fm . width ( ' ' ) * abs ( c . tab_width ) widget . setTabStopWidth ( width ) else : pass
short_docstring: Set the width of a hard tab.
short_docstring_tokens: Set the width of a hard tab .
comment: """
          Set the width of a hard tab.
  
          Qt does not appear to have the required methods. Indeed,
          https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt
          assumes that QTextEdit's have only a single font(!).
  
          This method probabably only works probably if the body text contains
          a single @language directive, and it may not work properly even then.
          """$SEP$# #1919: https://forum.qt.io/topic/99371/how-to-set-tab-stop-width-and-space-width$SEP$# fm.horizontalAdvance$SEP$# Obsolete.$SEP$# To do: configure the QScintilla widget.