def updateEditorGeometry(self, editor, option, index): ''' PyQt API Method -- See the PyQt documentation for a description ''' if type(editor) == QComboBox: editor.setGeometry(option.rect) editor.showPopup() else: QItemDelegate.updateEditorGeometry(self, editor, option, index)
def updateEditorGeometry(self, editor, option, index): """ Here we're gonna make the text edit of the message column bigger. """ model = index.model() columns = model.get_git_model().get_columns() field_name = columns[index.column()] if field_name != "message": QItemDelegate.updateEditorGeometry(self, editor, option, index) return message = model.data(index, Qt.EditRole) new_geometry = option.rect new_height = 27 * message.toString().count("\n") or option.rect.height() new_geometry.setHeight(new_height) editor.setGeometry(new_geometry)
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)
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)
def updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex): QItemDelegate.updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
def updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex): QItemDelegate.updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)