本文整理汇总了Python中PyQt4.QtGui.QItemDelegate.updateEditorGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QItemDelegate.updateEditorGeometry方法的具体用法?Python QItemDelegate.updateEditorGeometry怎么用?Python QItemDelegate.updateEditorGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QItemDelegate
的用法示例。
在下文中一共展示了QItemDelegate.updateEditorGeometry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateEditorGeometry
# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import updateEditorGeometry [as 别名]
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)
示例2: updateEditorGeometry
# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import updateEditorGeometry [as 别名]
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)
示例3: updateEditorGeometry
# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import updateEditorGeometry [as 别名]
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)
示例4: updateEditorGeometry
# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import updateEditorGeometry [as 别名]
def updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex):
QItemDelegate.updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)