本文整理汇总了Python中pyqtgraph.Qt.QtGui.QLineEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QLineEdit方法的具体用法?Python QtGui.QLineEdit怎么用?Python QtGui.QLineEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.Qt.QtGui
的用法示例。
在下文中一共展示了QtGui.QLineEdit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyPressEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLineEdit [as 别名]
def keyPressEvent(self, event, *args, **kwargs):
if event.key() == QtCore.Qt.Key_Enter:
self.sigTextChanged.emit(True)
else:
QtGui.QLineEdit.keyPressEvent(self, event, *args, **kwargs)
示例2: __init__
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLineEdit [as 别名]
def __init__(self, params_data, changed_params_data, *args, **kwargs):
self.params_data = params_data
self.params_data_show = list(self.params_data.keys())
self.changed_params_data = changed_params_data
super().__init__(*args, **kwargs)
self.resize(QtCore.QSize(500,500))
self.params_table = QtGui.QTableWidget()
self.choose_item_lineEdit = QtGui.QLineEdit(self)
self.choose_item_lineEdit.setPlaceholderText('filter by data name')
self.choose_item_lineEdit.textChanged.connect(self.callback_filter)
self.btn_changed_filter = QtGui.QPushButton('Changed')
self.btn_changed_filter.clicked.connect(self.btn_changed_filter_clicked)
w = QtGui.QWidget()
self.vlayout = QtGui.QVBoxLayout(w)
self.hlayout = QtGui.QHBoxLayout(self)
self.setCentralWidget(w)
self.centralWidget().setLayout(self.vlayout)
self.vlayout.addWidget(self.params_table)
self.vlayout.addLayout(self.hlayout)
self.hlayout.addWidget(self.btn_changed_filter)
self.hlayout.addWidget(self.choose_item_lineEdit)
self.params_table.setEditTriggers(QtGui.QAbstractItemView.DoubleClicked |
QtGui.QAbstractItemView.SelectedClicked)
self.params_table.setSortingEnabled(False)
self.params_table.horizontalHeader().setStretchLastSection(True)
self.params_table.resizeColumnsToContents()
self.params_table.setColumnCount(2)
self.params_table.setColumnWidth(0, 120)
self.params_table.setColumnWidth(1, 50)
self.params_table.setHorizontalHeaderLabels(['Name', 'value'])
self.show_all_params = True
self.filtertext = ''
self.update_table()