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


Python QItemSelection.merge方法代码示例

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


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

示例1: setSelectedItems

# 需要导入模块: from PyQt4.QtGui import QItemSelection [as 别名]
# 或者: from PyQt4.QtGui.QItemSelection import merge [as 别名]
 def setSelectedItems(self, items):
     #block = self.blockSignals(True)
     sel = QItemSelection()
     for item in items:
         sel.merge(QItemSelection(item.index(), item.index(1)), QItemSelectionModel.SelectCurrent)
     if set(sel) != set(self.selectionModel().selection()):
         self.selectionModel().clear()
         self.selectionModel().select(sel, QItemSelectionModel.Select)
开发者ID:cvhciKIT,项目名称:sloth,代码行数:10,代码来源:model.py

示例2: set_selection

# 需要导入模块: from PyQt4.QtGui import QItemSelection [as 别名]
# 或者: from PyQt4.QtGui.QItemSelection import merge [as 别名]
 def set_selection(self):
     if len(self.selected_rows) and len(self.selected_cols):
         view = self.tabs.currentWidget()
         selection = QItemSelection()
         temp_selection = QItemSelection()
         for row in self.selected_rows:
             for col in self.selected_cols:
                 index = view.model().index(row, col)
                 temp_selection.select(index, index)
                 selection.merge(temp_selection, QItemSelectionModel.Select)
         view.selectionModel().select(selection,
                                      QItemSelectionModel.ClearAndSelect)
开发者ID:PythonCharmers,项目名称:orange3,代码行数:14,代码来源:owtable.py

示例3: updateCoordinate

# 需要导入模块: from PyQt4.QtGui import QItemSelection [as 别名]
# 或者: from PyQt4.QtGui.QItemSelection import merge [as 别名]
 def updateCoordinate(self,row,c0,c1):
     # respect the limits
     # NOSORT
     if False and ((row > 0 and c0 <= self.coordinates[row-1][0]) or ((row < len(self.coordinates) - 1 and c0 >= self.coordinates[row+1][0]))):
         return
     else:
         selectedCoordinates = self.getSelectedCoordinates()        
         self.beginResetModel()        
         self.coordinates[row][0] = c0
         self.coordinates[row][1] = int(c1)
         self.endResetModel()
         self.computePolyfit()
         selection = QItemSelection()
         for i,c in enumerate(self.coordinates):
             if c in selectedCoordinates:
                 selection.merge(QItemSelection(self.createIndex(i,0),self.createIndex(i,1)),QItemSelectionModel.Select)
         self.app.aw.ui.tableView.selectionModel().select(selection,QItemSelectionModel.Select)
         self.app.contentModified()
开发者ID:myTonino,项目名称:Tonino-App,代码行数:20,代码来源:scales.py

示例4: redoSelection

# 需要导入模块: from PyQt4.QtGui import QItemSelection [as 别名]
# 或者: from PyQt4.QtGui.QItemSelection import merge [as 别名]
 def redoSelection(self,selectedCoordinates):
     selection = QItemSelection()
     for i,c in enumerate(self.coordinates):
         if c in selectedCoordinates:
             selection.merge(QItemSelection(self.createIndex(i,0),self.createIndex(i,1)),QItemSelectionModel.Select)
     self.app.aw.ui.tableView.selectionModel().select(selection,QItemSelectionModel.Select)
开发者ID:myTonino,项目名称:Tonino-App,代码行数:8,代码来源:scales.py


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