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


Python QItemDelegate.setModelData方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QItemDelegate.setModelData方法的典型用法代码示例。如果您正苦于以下问题:Python QItemDelegate.setModelData方法的具体用法?Python QItemDelegate.setModelData怎么用?Python QItemDelegate.setModelData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QItemDelegate的用法示例。


在下文中一共展示了QItemDelegate.setModelData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self,editor,model,index):
     """Save value changes"""
     if index.column() == 1:
         value, ok = editor.itemData(editor.currentIndex()).toInt()
         model.setData(index,QVariant(value),Qt.EditRole)
     else:
         QItemDelegate.setModelData(self,editor,model,index)
开发者ID:toyg,项目名称:plasmaapplets,代码行数:9,代码来源:main.py

示例2: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     """ save data from editor back to model """
     if index.column() == self.column:
         model.setData(index, editor.currentText())
     else:
         # use default
         QItemDelegate.setModelData(self, editor, model, index)
开发者ID:alexdsz,项目名称:DsgTools,代码行数:9,代码来源:manageComplex.py

示例3: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     """ save data from editor back to model """
     if index.column() == 1:
         model.setData(index, editor.currentText())
     else:
         # use default
         QItemDelegate.setModelData(self, editor, model, index)
         if index.column() == 0:
             self.emit(SIGNAL("columnNameChanged()"))
开发者ID:Geoneer,项目名称:QGIS,代码行数:11,代码来源:dlg_create_table.py

示例4: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     if isinstance(editor, QComboBox):
         model.setData(index, QVariant(editor.currentText()), Qt.EditRole)
     elif isinstance(editor, QTextEdit):
         model.setData(index, QVariant(editor.toPlainText()), Qt.EditRole)
     else:
         return QItemDelegate.setModelData(self, editor, model, index)
开发者ID:Araneidae,项目名称:iocbuilder,代码行数:9,代码来源:delegates.py

示例5: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, QWidget, QAbstractItemModel, QModelIndex):
     QItemDelegate.setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
开发者ID:SevenLines,项目名称:Python-Turing-Machine,代码行数:4,代码来源:header_delegate.py

示例6: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     if isinstance(editor, QComboBox):
         self.comboDel.setModelData(editor, model, index)
     else:
         QItemDelegate.setModelData(self, editor, model, index)
开发者ID:cklb,项目名称:pymoskito,代码行数:7,代码来源:simulation_interface.py

示例7: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     if index.column() in (MOD1, MOD2, MOD3, KEY):
         model.setData(index, to_qvariant(editor.currentText()))
     else:
         QItemDelegate.setModelData(self, editor, model, index)
开发者ID:koll00,项目名称:Gui_SM,代码行数:7,代码来源:shortcuts.py

示例8: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     """ PyQt API Method -- See the PyQt documentation for a description """
     if type(editor) == QComboBox:
         model.setData(index, QVariant(editor.currentText()), Qt.EditRole)
     else:
         QItemDelegate.setModelData(self, editor, model, index)
开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:8,代码来源:xml_item_delegate.py

示例9: setModelData

# 需要导入模块: from PyQt4.QtGui import QItemDelegate [as 别名]
# 或者: from PyQt4.QtGui.QItemDelegate import setModelData [as 别名]
 def setModelData(self, editor, model, index):
     delegate = self.delegates.get(index.column())
     if delegate is not None:
         delegate.setModelData(editor, model, index)
     else:
         QItemDelegate.setModelData(self, editor, model, index)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:8,代码来源:genericdelegates.py


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