本文整理汇总了Python中PyQt5.QtWidgets.QLineEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QLineEdit方法的具体用法?Python QtWidgets.QLineEdit怎么用?Python QtWidgets.QLineEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QLineEdit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, setting_params=None):
super().__init__()
self.setting_params = setting_params
self.search_input = Qw.QLineEdit()
self.table = AngryTableView(self.setting_params['angrysearch_lite'],
self.setting_params['row_height'])
self.upd_button = Qw.QPushButton('update')
self.fts_checkbox = Qw.QCheckBox()
grid = Qw.QGridLayout()
grid.setSpacing(10)
grid.addWidget(self.search_input, 1, 1)
grid.addWidget(self.fts_checkbox, 1, 3)
grid.addWidget(self.upd_button, 1, 4)
grid.addWidget(self.table, 2, 1, 4, 4)
self.setLayout(grid)
self.setTabOrder(self.search_input, self.table)
self.setTabOrder(self.table, self.upd_button)
# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS
示例2: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None, win=None, session=None):
super(ResourcesWindow, self).__init__(parent)
self.mainwin = win
self.session = session
self.title = "Resources"
self.filterPatternLineEdit = QtWidgets.QLineEdit()
self.filterPatternLabel = QtWidgets.QLabel("&Filter resource integer pattern:")
self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)
self.resourceswindow = ResourcesValueWindow(self, win, session)
sourceLayout = QtWidgets.QVBoxLayout()
sourceLayout.addWidget(self.resourceswindow)
sourceLayout.addWidget(self.filterPatternLabel)
sourceLayout.addWidget(self.filterPatternLineEdit)
self.setLayout(sourceLayout)
示例3: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None, win=None, session=None):
super(StringsWindow, self).__init__(parent)
self.mainwin = win
self.session = session
self.title = "Strings"
self.filterPatternLineEdit = QtWidgets.QLineEdit()
self.filterPatternLabel = QtWidgets.QLabel("&Filter string pattern:")
self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)
self.stringswindow = StringsValueWindow(self, win, session)
sourceLayout = QtWidgets.QVBoxLayout()
sourceLayout.addWidget(self.stringswindow)
sourceLayout.addWidget(self.filterPatternLabel)
sourceLayout.addWidget(self.filterPatternLineEdit)
self.setLayout(sourceLayout)
示例4: exclude_dialog
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def exclude_dialog(self):
text, ok = Qw.QInputDialog.getText(
self, '~/.config/angrysearch/', 'Directories to be ignored:',
Qw.QLineEdit.Normal, self.exclud_dirs)
if ok:
text = text.strip()
self.exclud_dirs = text
self.settings.setValue('directories_excluded', text)
self.parent().setting_params['directories_excluded'] = text.strip().split()
if text == '':
self.excluded_dirs_btn.setText('none')
self.excluded_dirs_btn.setStyleSheet('color:#888;'
'font:italic;')
else:
self.excluded_dirs_btn.setText(text)
self.excluded_dirs_btn.setStyleSheet('')
self.OK_button.setFocus()
示例5: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, items, parent=None):
super(ButtonLineEdit, self).__init__(parent)
self.menu = QtWidgets.QMenu()
for i in items:
self.menu.addAction(i)
self.button = QtWidgets.QToolButton(self)
self.button.setStyleSheet('border: 0px; padding: 0px;')
self.button.setCursor(QtCore.Qt.ArrowCursor)
self.button.triggered.connect(self.menu_action_triggered)
self.button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
self.button.setMenu(self.menu)
frameWidth = self.style().pixelMetric(QtWidgets.QStyle.PM_DefaultFrameWidth)
buttonSize = self.button.sizeHint()
self.setAlignment(QtCore.Qt.Alignment(QtCore.Qt.AlignHCenter))
self.setStyleSheet('QLineEdit {padding-right: %dpx; }' % (buttonSize.width() + frameWidth + 1))
self.setMinimumSize(max(self.minimumSizeHint().width(), buttonSize.width() + frameWidth*2 + 2),
max(self.minimumSizeHint().height(), buttonSize.height() + frameWidth*2 + 2))
self.setMaximumWidth(100)
示例6: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None, win=None, element="", info=()):
super(RenameDialog, self).__init__(parent)
self.sourceWin = parent
self.info = info
self.element = element
title = "Rename: " + element
self.setWindowTitle(title)
layout = QtWidgets.QGridLayout()
question = QtWidgets.QLabel("Please enter new name:")
layout.addWidget(question, 0, 0)
self.lineEdit = QtWidgets.QLineEdit()
layout.addWidget(self.lineEdit, 0, 1)
self.buttonOK = QtWidgets.QPushButton("OK", self)
layout.addWidget(self.buttonOK, 1, 1)
self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
layout.addWidget(self.buttonCancel, 1, 0)
self.lineEdit.setText(self.element)
self.setLayout(layout)
self.buttonCancel.clicked.connect(self.cancelClicked)
self.buttonOK.clicked.connect(self.okClicked)
示例7: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None, win=None, session=None):
super(MethodsWindow, self).__init__(parent)
self.mainwin = win
self.session = session
self.title = "Methods"
self.filterPatternLineEdit = QtWidgets.QLineEdit()
self.filterPatternLabel = QtWidgets.QLabel("&Filter method name pattern:")
self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)
self.methodswindow = MethodsValueWindow(self, win, session)
sourceLayout = QtWidgets.QVBoxLayout()
sourceLayout.addWidget(self.methodswindow)
sourceLayout.addWidget(self.filterPatternLabel)
sourceLayout.addWidget(self.filterPatternLineEdit)
self.setLayout(sourceLayout)
示例8: initUI
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def initUI(self):
self.inputLabel = QLabel("Input your text")
self.editLine = QLineEdit()
self.printButton = QPushButton("Print")
self.clearButton = QPushButton("Clear")
self.printButton.clicked.connect(self.printText)
self.clearButton.clicked.connect(self.clearText)
inputLayout = QHBoxLayout()
inputLayout.addWidget(self.inputLabel)
inputLayout.addWidget(self.editLine)
buttonLayout = QHBoxLayout()
buttonLayout.addWidget(self.printButton)
buttonLayout.addWidget(self.clearButton)
mainLayout = QVBoxLayout()
mainLayout.addLayout(inputLayout)
mainLayout.addLayout(buttonLayout)
self.setLayout(mainLayout)
self.setWindowTitle('FristWindow')
self.show()
示例9: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def setupUi(self, ScoreWindow):
ScoreWindow.setObjectName("ScoreWindow")
ScoreWindow.resize(471, 386)
self.centralwidget = QtWidgets.QWidget(ScoreWindow)
self.centralwidget.setObjectName("centralwidget")
self.Score = QtWidgets.QLineEdit(self.centralwidget)
self.Score.setGeometry(QtCore.QRect(180, 180, 113, 22))
self.Score.setObjectName("Score")
self.teamscore = QtWidgets.QLabel(self.centralwidget)
self.teamscore.setGeometry(QtCore.QRect(180, 130, 151, 20))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.teamscore.setFont(font)
self.teamscore.setObjectName("teamscore")
ScoreWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(ScoreWindow)
self.statusbar.setObjectName("statusbar")
ScoreWindow.setStatusBar(self.statusbar)
self.retranslateUi(ScoreWindow)
QtCore.QMetaObject.connectSlotsByName(ScoreWindow)
示例10: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent):
self.parent = parent
self.parentTab = self.parent.parent
self.searchThread = BackGroundTextSearch()
self.searchOptionsLayout = QtWidgets.QHBoxLayout()
self.searchTabLayout = QtWidgets.QVBoxLayout()
self.searchTimer = QtCore.QTimer(self.parent)
self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
self.searchBookButton = QtWidgets.QToolButton(self.parent)
self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)
self._translate = QtCore.QCoreApplication.translate
self.search_string = self._translate('SideDock', 'Search')
self.search_book_string = self._translate('SideDock', 'Search entire book')
self.case_sensitive_string = self._translate('SideDock', 'Match case')
self.match_word_string = self._translate('SideDock', 'Match word')
self.create_widgets()
示例11: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, name, parent=None):
super(Chatter, self).__init__(parent)
self.name = name
self.text_panel = QtWidgets.QTextEdit()
self.text_panel.setReadOnly(True)
self.input = QtWidgets.QLineEdit()
layout = QtWidgets.QVBoxLayout()
layout.addWidget(self.text_panel, 3)
layout.addWidget(self.input, 1)
self.setLayout(layout)
self.setWindowTitle("Chatter")
self.input.editingFinished.connect(self.input_changed)
self.input.setFocus()
self.chattery = nw0.discover("chattery/news")
self.responder = FeedbackReader(self.chattery)
self.responder.message_received.connect(self.handle_response)
self.responder.start()
示例12: _initUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self, title, label, default):
self.setWindowTitle(title)
# 控件
label_ = QLabel(label)
self._lineEdit = QLineEdit(str(self._data['data']) if self._data else str(default) )
cancelPushButton = QPushButton('Cancel')
okPushButton = QPushButton('OK')
cancelPushButton.clicked.connect(self._cancel)
okPushButton.clicked.connect(self._ok)
# 布局
grid = QGridLayout()
grid.setSpacing(10)
grid.addWidget(label_, 0, 0, 1, 2)
grid.addWidget(self._lineEdit, 0, 2, 1, 2)
grid.addWidget(okPushButton, 1, 2, 1, 2)
grid.addWidget(cancelPushButton, 1, 0, 1, 2)
self.setLayout(grid)
示例13: _initUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self):
self.setWindowTitle('进程数')
# 控件
processNbrLable = QLabel('进程数')
self._processNbrLineEdit = QLineEdit(str(self._data['nbr']) if self._data else '0' )
cancelPushButton = QPushButton('Cancel')
okPushButton = QPushButton('OK')
cancelPushButton.clicked.connect(self._cancel)
okPushButton.clicked.connect(self._ok)
# 布局
grid = QGridLayout()
grid.setSpacing(10)
grid.addWidget(processNbrLable, 0, 0)
grid.addWidget(self._processNbrLineEdit, 1, 0, 1, 2)
grid.addWidget(okPushButton, 2, 1)
grid.addWidget(cancelPushButton, 2, 0)
self.setLayout(grid)
示例14: _initUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self):
self.setWindowTitle('日K线前后交易日周期')
# 控件
dayKChartPeriodLable = QLabel('股票(指数)日K线前后交易日周期')
self._dayKChartPeriodLineEdit = QLineEdit(str(self._data['periodNbr']) if self._data else '60' )
cancelPushButton = QPushButton('Cancel')
okPushButton = QPushButton('OK')
cancelPushButton.clicked.connect(self._cancel)
okPushButton.clicked.connect(self._ok)
# 布局
grid = QGridLayout()
grid.setSpacing(10)
grid.addWidget(dayKChartPeriodLable, 0, 0, 1, 2)
grid.addWidget(self._dayKChartPeriodLineEdit, 1, 0, 1, 2)
grid.addWidget(okPushButton, 2, 1)
grid.addWidget(cancelPushButton, 2, 0)
self.setLayout(grid)
示例15: _createConnectionTab
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _createConnectionTab(self, tabWidget):
widget = QWidget()
labelHost = QLabel('主机')
labelPort = QLabel('端口')
self._lineEditHost = QLineEdit(self._data['Connection']["Host"])
self._lineEditPort = QLineEdit(str(self._data['Connection']["Port"]))
# 布局
grid = QGridLayout()
grid.setSpacing(10)
grid.addWidget(labelHost, 0, 0)
grid.addWidget(self._lineEditHost, 0, 1)
grid.addWidget(labelPort, 0, 2)
grid.addWidget(self._lineEditPort, 0, 3)
widget.setLayout(grid)
tabWidget.addTab(widget, "连接")