def updateEditorGeometry(self, editor, option, index): option.rect.setSize(editor.minimumSizeHint().expandedTo( option.rect.size())) if isinstance(editor, QComboBox): editor.setGeometry(option.rect) elif isinstance(editor, QTextEdit): editor.setMinimumWidth(480) editor.setMinimumHeight(160) else: return QItemDelegate.updateEditorGeometry(self, editor, option, index)