本文整理汇总了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)
示例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)
示例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()
示例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)