'Returns the widget size hint (based on the editor font size)'

def sizeHint(self):

    fm = QFontMetricsF(self.editor.font())
    size_hint = QSize(fm.height(), fm.height())
    if (size_hint.width() > 16):
        size_hint.setWidth(16)
    return size_hint
