当前位置: 首页>>代码示例>>Python>>正文


Python QItemDelegate.updateEditorGeometry方法代码示例

本文整理汇总了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)
开发者ID:janowicz,项目名称:urbansim_drcog,代码行数:9,代码来源:xml_item_delegate.py

示例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)
开发者ID:mike-perdide,项目名称:gitbuster,代码行数:21,代码来源:q_git_delegate.py

示例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)
开发者ID:Araneidae,项目名称:iocbuilder,代码行数:12,代码来源:delegates.py

示例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)
开发者ID:SevenLines,项目名称:Python-Turing-Machine,代码行数:4,代码来源:header_delegate.py


注:本文中的PyQt4.QtGui.QItemDelegate.updateEditorGeometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。