本文整理汇总了Python中PyQt4.Qt.QTableView.installEventFilter方法的典型用法代码示例。如果您正苦于以下问题:Python QTableView.installEventFilter方法的具体用法?Python QTableView.installEventFilter怎么用?Python QTableView.installEventFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTableView
的用法示例。
在下文中一共展示了QTableView.installEventFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWidget
# 需要导入模块: from PyQt4.Qt import QTableView [as 别名]
# 或者: from PyQt4.Qt.QTableView import installEventFilter [as 别名]
#.........这里部分代码省略.........
self.showGaussAction.triggered.connect(self.showGauss)
viewMenu.addAction(self.showGaussAction)
self.showFreqAction = QAction('Show &IR frequency plot', self)
self.showFreqAction.setShortcut('Ctrl+I')
self.showFreqAction.setStatusTip('Show Gaussian calculated IR frequency plot.')
self.showFreqAction.setEnabled(False)
self.showFreqAction.triggered.connect(self.showFreq)
viewMenu.addAction(self.showFreqAction)
measureDistanceAction = QAction('&Measure &distance', self)
measureDistanceAction.setShortcut('Ctrl+D')
measureDistanceAction.setStatusTip('Measure distance between two atoms')
measureDistanceAction.triggered.connect(self.measureDistanceB)
measureMenu.addAction(measureDistanceAction)
measureAngleAction = QAction('&Measure &angle', self)
measureAngleAction.setShortcut('Ctrl+Shift+D')
measureAngleAction.setStatusTip('Measure angle between three atoms')
measureAngleAction.triggered.connect(self.measureAngleB)
measureMenu.addAction(measureAngleAction)
aboutAction = QAction('&About', self)
aboutAction.setStatusTip('About this program...')
aboutAction.triggered.connect(self.about)
helpMenu.addAction(aboutAction)
aboutQtAction = QAction('&About Qt', self)
aboutQtAction.setStatusTip('About Qt...')
aboutQtAction.triggered.connect(self.aboutQt)
helpMenu.addAction(aboutQtAction)
# define GL widget that displays the 3D molecule model
self.window = widgets.MyGLView()
self.window.installEventFilter(self)
self.window.setMinimumSize(500, 500)
#self.window.setBackgroundColor((50, 0, 10))
self.updateView()
self.gaussianPlot = GraphicsLayoutWidget()
self.gaussianPlot.resize(750, 250)
self.gaussianPlot.setWindowTitle('Gaussian geometry optimization')
#self.gaussianPlot.setAspectLocked(True)
#self.gaussianPlot.addLayout(rowspan=3, colspan=1)
self.FreqModel = QStandardItemModel(1, 3, self)
self.freqTable = QTableView(self)
self.freqTable.setModel(self.FreqModel)
self.freqTable.setMinimumWidth(240)
self.freqTable.installEventFilter(self)
self.FreqModel.installEventFilter(self)
self.FreqModel.setHorizontalHeaderLabels(['Frequency','IR Intensity','Raman Intensity'])
for j, width in enumerate([80, 80, 80]):
self.freqTable.setColumnWidth(j, width)
self.freqWidget = QWidget()
self.freqWidget.setWindowTitle('IR frequency plot & table')
self.freqWidget.resize(800, 400)
self.freqWidget.layout = QHBoxLayout(self.freqWidget)
self.freqWidget.layout.setSpacing(1)
self.freqWidget.layout.setContentsMargins(1, 1, 1, 1)
self.freqPlot = GraphicsLayoutWidget()
self.freqWidget.layout.addWidget(self.freqPlot)
self.freqWidget.layout.addWidget(self.freqTable)
self.freqTable.clicked.connect(self.freqCellClicked)
# define other application parts