本文整理汇总了Python中PyQt4.Qt.QTableView.clearSelection方法的典型用法代码示例。如果您正苦于以下问题:Python QTableView.clearSelection方法的具体用法?Python QTableView.clearSelection怎么用?Python QTableView.clearSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTableView
的用法示例。
在下文中一共展示了QTableView.clearSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWidget
# 需要导入模块: from PyQt4.Qt import QTableView [as 别名]
# 或者: from PyQt4.Qt.QTableView import clearSelection [as 别名]
#.........这里部分代码省略.........
self.build()
# also do the default click action
return super(MainWidget, self).eventFilter(obj, event)
def ZMatCellClicked(self):
idxs = sorted(set(idx.row() for idx in self.ZMatTable.selectedIndexes()), reverse=True)
itms = []
if self.highList:
highIdx = list(np.array(self.highList).T[0])
for idx in idxs:
if self.highList and idx in highIdx:
itms.append(self.highList[highIdx.index(idx)][1])
elif len(self.atomList) > idx:
itms.append(self.atomList[idx][1])
self.highlight(self.window, itms)
def freqCellClicked(self):
global vsShifted
self.timer = QTimer()
self.timer.setInterval(30)
self.timer.timeout.connect(self.updateFreq)
idxs = [ idx.row() for idx in self.freqTable.selectedIndexes() ]
if len(idxs) == 1:
self.freqIndex = idxs[0]
self.timer.stop()
self.timer.timeout.connect(self.updateFreq)
try:
self.ZMatModel.dataChanged.disconnect(self.clearUpdateView)
except TypeError:
pass
self.timer.start()
if len(idxs) != 1:
self.timer.stop()
self.freqTable.clearSelection()
self.timer.timeout.disconnect(self.updateFreq)
self.ZMatModel.dataChanged.connect(self.clearUpdateView)
self.clearUpdateView()
def gausclicked(self, item, point):
itemdata = item.scatter.data
points = [ row[7] for row in itemdata ]
idx = points.index(point[0])
for i in range(3):
if i == 0:
x = [idx]
y = [self.scfenergies[idx]]
else:
x = [idx, idx]
y = [self.geovalues[2*i-2][idx], self.geovalues[2*i-1][idx]]
plot = self.gaussianPlot.getItem(1, i+1)
plot.removeItem(plot.highlight)
plot.highlight=plot.plot(x, y, symbol='o', symbolPen='w', symbolBrush=None, pen=None, symbolSize=15, pxMode=True, antialias=True, autoDownsample=False)
self.ZMatModel.dataChanged.disconnect(self.clearUpdateView)
self.inp = []
self.populateZMatModel()
self.inp = xyz2zmat(self.atomcoords[min(idx, len(self.atomcoords)-1)], self.atomsymbols)
self.populateZMatModel()
self.ZMatModel.dataChanged.connect(self.clearUpdateView)
self.updateView()
def highlight(self, obj, itms):
for itm in itms:
idx = next((i for i, sublist in enumerate(self.atomList) if itm in sublist), -1)
#print(idx)
if idx != -1:
addAtom(obj, idx, r, vs, c, opt='highlight', fast=self.fast)