code: def sizeHint(self):
          
          fm = QFontMetrics(self.editor.font())
          size_hint = QSize(fm.height(), fm.height())
          if size_hint.width() > 16:
              size_hint.setWidth(16)
          return size_hint
docs: Override Qt method.
  
          Returns the widget size hint (based on the editor font size).