本文整理匯總了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()