本文整理汇总了Python中PySide2.QtWidgets.QLineEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QLineEdit方法的具体用法?Python QtWidgets.QLineEdit怎么用?Python QtWidgets.QLineEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QLineEdit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None):
super(BrowseEdit, self).__init__(parent)
self.text = QtWidgets.QLineEdit()
self.text.returnPressed.connect(self.apply)
self.button = QtWidgets.QPushButton('B')
self.button.setFixedSize(21, 21)
self.button.released.connect(self.browse)
self.layout = QtWidgets.QHBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setSpacing(0)
self.layout.addWidget(self.text)
self.layout.addWidget(self.button)
self._value = self.value()
示例2: createTweetsGroupBox
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def createTweetsGroupBox(self):
self.tweets_group_box = QtWidgets.QGroupBox("Tweets")
self.account_address = QtWidgets.QLineEdit()
self.fetch_button = QtWidgets.QPushButton("Fetch")
self.add_to_bookmark_button = QtWidgets.QPushButton("Bookmark it!")
self.connect(self.fetch_button, QtCore.SIGNAL('clicked()'), self.fetchTweets)
self.connect(self.add_to_bookmark_button, QtCore.SIGNAL('clicked()'), self.bookmarkAddress)
account_address_layout = QtWidgets.QHBoxLayout()
account_address_layout.addWidget(self.account_address)
account_address_layout.addWidget(self.fetch_button)
account_address_layout.addWidget(self.add_to_bookmark_button)
self.tweets_layout = QtWidgets.QVBoxLayout()
self.tweets_main_layout = QtWidgets.QVBoxLayout()
self.tweets_main_layout.addWidget(QtWidgets.QLabel("Address:"))
self.tweets_main_layout.addLayout(account_address_layout)
self.tweets_main_layout.addSpacing(20)
self.tweets_main_layout.addLayout(self.tweets_layout)
self.tweets_group_box.setLayout(self.tweets_main_layout)
示例3: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, code_view, instance, options=None, passes=None):
super().__init__()
self._code_view = code_view
self._instance = instance
self._options = options
self._opti_passes = passes
# widgets
self._search_box = None # type:QLineEdit
self._treewidget = None # type:QTreeWidget
self._apply_btn = None # type:QPushButton
self._qoptions = [ ]
self._qoptipasses = [ ]
self._init_widgets()
self.reload()
示例4: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def _init_widgets(self):
# search box
self._search_box = QLineEdit()
# tree view
self._treewidget = QTreeWidget()
self._treewidget.setHeaderHidden(True)
# refresh button
self._apply_btn = QPushButton("Apply")
self._apply_btn.clicked.connect(self._code_view.decompile)
layout = QVBoxLayout()
layout.addWidget(self._search_box)
layout.addWidget(self._treewidget)
layout.addWidget(self._apply_btn)
self.setLayout(layout)
示例5: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent, name, data):
if not type(data) == binaryninja.binaryview.BinaryView:
raise Exception('expected widget data to be a BinaryView')
self.bv = data
QWidget.__init__(self, parent)
DockContextHandler.__init__(self, self, name)
self.actionHandler = UIActionHandler()
self.actionHandler.setupActionHandler(self)
layout = QVBoxLayout()
self.consoleText = QTextEdit(self)
self.consoleText.setReadOnly(True)
self.consoleText.setFont(getMonospaceFont(self))
layout.addWidget(self.consoleText, 1)
inputLayout = QHBoxLayout()
inputLayout.setContentsMargins(4, 4, 4, 4)
promptLayout = QVBoxLayout()
promptLayout.setContentsMargins(0, 5, 0, 5)
inputLayout.addLayout(promptLayout)
self.consoleEntry = QLineEdit(self)
inputLayout.addWidget(self.consoleEntry, 1)
self.entryLabel = QLabel("dbg>>> ", self)
self.entryLabel.setFont(getMonospaceFont(self))
promptLayout.addWidget(self.entryLabel)
promptLayout.addStretch(1)
self.consoleEntry.returnPressed.connect(lambda: self.sendLine())
layout.addLayout(inputLayout)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
self.setLayout(layout)
示例6: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None):
super(HotboxGeneralSettingWidget, self).__init__(parent)
self.setFixedWidth(200)
self.name = QtWidgets.QLineEdit()
self.name.textEdited.connect(partial(self.optionSet.emit, 'name'))
self.submenu = BoolCombo(False)
self.submenu.valueSet.connect(partial(self.optionSet.emit, 'submenu'))
self.triggering = QtWidgets.QComboBox()
self.triggering.addItems(TRIGGERING_TYPES)
self.triggering.currentIndexChanged.connect(self._triggering_changed)
self.aiming = BoolCombo(False)
self.aiming.valueSet.connect(partial(self.optionSet.emit, 'aiming'))
self.leaveclose = BoolCombo(False)
method = partial(self.optionSet.emit, 'leaveclose')
self.leaveclose.valueSet.connect(method)
self.open_command = CommandButton('show')
self.close_command = CommandButton('hide')
self.switch_command = CommandButton('switch')
self.layout = QtWidgets.QFormLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setSpacing(0)
self.layout.setHorizontalSpacing(5)
self.layout.addRow(Title('Options'))
self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
self.layout.addRow('name', self.name)
self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
self.layout.addRow('is submenu', self.submenu)
self.layout.addRow('triggering', self.triggering)
self.layout.addRow('aiming', self.aiming)
self.layout.addRow('close on leave', self.leaveclose)
self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
self.layout.addRow(Title('Commands'))
self.layout.addItem(QtWidgets.QSpacerItem(0, 8))
self.layout.addRow(self.open_command)
self.layout.addRow(self.close_command)
self.layout.addRow(self.switch_command)
示例7: createPrivateKeyGroupBox
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def createPrivateKeyGroupBox(self):
self.private_key_group_box = QtWidgets.QGroupBox("Account")
self.private_key_field = QtWidgets.QLineEdit()
self.welcome_message = QtWidgets.QLabel()
layout = QtWidgets.QFormLayout()
layout.addRow(QtWidgets.QLabel("Private key:"), self.private_key_field)
button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok)
button_box.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self.checkPrivateKey)
layout.addRow(button_box)
layout.addRow(self.welcome_message)
self.private_key_group_box.setLayout(layout)
示例8: writeANewTweet
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def writeANewTweet(self):
text, ok = QtWidgets.QInputDialog.getText(self, "Write a new tweet",
"Tweet:", QtWidgets.QLineEdit.Normal, "")
if ok and text != '':
self.web3_write_a_tweet_thread.setPrivateKey(self.private_key)
self.web3_write_a_tweet_thread.setTweet(text)
self.web3_write_a_tweet_thread.start()
示例9: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(360, 180)
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
self.cbObjType = QtWidgets.QComboBox(Form)
self.cbObjType.setObjectName("cbObjType")
self.cbObjType.addItem("")
self.cbObjType.addItem("")
self.gridLayout.addWidget(self.cbObjType, 0, 1, 1, 1)
self.btnCreate = QtWidgets.QPushButton(Form)
self.btnCreate.setObjectName("btnCreate")
self.gridLayout.addWidget(self.btnCreate, 0, 2, 1, 1)
self.label = QtWidgets.QLabel(Form)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.leNewName = QtWidgets.QLineEdit(Form)
self.leNewName.setObjectName("leNewName")
self.gridLayout.addWidget(self.leNewName, 1, 1, 1, 1)
self.btnRename = QtWidgets.QPushButton(Form)
self.btnRename.setObjectName("btnRename")
self.gridLayout.addWidget(self.btnRename, 1, 2, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例10: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, node):
super().__init__()
self.node = node
self.show_help = True
self.layout = QGridLayout()
self.setLayout(self.layout)
self.output_area = QTextEdit()
self.output_area.setReadOnly(True)
self.output_area.acceptRichText = True
self.output_area.document().setMaximumBlockCount(5000)
self.layout.addWidget(self.output_area)
self.input_area = QLineEdit()
self.completer = QCompleter()
# noinspection PyUnresolvedReferences
self.completer.setCaseSensitivity(Qt.CaseInsensitive)
self.input_area.setCompleter(self.completer)
self.input_area.setFocus()
self.layout.addWidget(self.input_area)
self.connect(self.input_area, SIGNAL("returnPressed(void)"),
self.execute_user_command)
示例11: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
Dialog.resize(364, 138)
Dialog.setModal(True)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setContentsMargins(-1, 10, -1, -1)
self.formLayout.setObjectName("formLayout")
self.login_or_email_label = QtWidgets.QLabel(Dialog)
self.login_or_email_label.setObjectName("login_or_email_label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.login_or_email_label)
self.login_or_email_lineEdit = QtWidgets.QLineEdit(Dialog)
self.login_or_email_lineEdit.setInputMask("")
self.login_or_email_lineEdit.setObjectName("login_or_email_lineEdit")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.login_or_email_lineEdit)
self.password_label = QtWidgets.QLabel(Dialog)
self.password_label.setObjectName("password_label")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.password_label)
self.password_lineEdit = QtWidgets.QLineEdit(Dialog)
self.password_lineEdit.setInputMask("")
self.password_lineEdit.setText("")
self.password_lineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
self.password_lineEdit.setObjectName("password_lineEdit")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.password_lineEdit)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.buttonBox)
self.verticalLayout.addLayout(self.formLayout)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
示例12: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(923, 542)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName("formLayout")
self.media_files_path_lineEdit = QtWidgets.QLineEdit(Dialog)
self.media_files_path_lineEdit.setObjectName("media_files_path_lineEdit")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.media_files_path_lineEdit)
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
self.verticalLayout.addLayout(self.formLayout)
self.edl_preview_plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
self.edl_preview_plainTextEdit.setReadOnly(True)
self.edl_preview_plainTextEdit.setObjectName("edl_preview_plainTextEdit")
self.verticalLayout.addWidget(self.edl_preview_plainTextEdit)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.send_pushButton = QtWidgets.QPushButton(Dialog)
self.send_pushButton.setObjectName("send_pushButton")
self.horizontalLayout_2.addWidget(self.send_pushButton)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
Dialog.setTabOrder(self.media_files_path_lineEdit, self.edl_preview_plainTextEdit)
Dialog.setTabOrder(self.edl_preview_plainTextEdit, self.send_pushButton)
示例13: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, parent=None):
super(myDialog, self).__init__(parent)
# Sets the title and size of the dialog box
self.setWindowTitle('myDialog')
self.resize(200, 100)
# Set the window to modal, and the user can only close the main
# interface after closing the popover
self.setWindowModality(Qt.ApplicationModal)
# Table layout used to layout QLabel and QLineEdit and QSpinBox
grid = QGridLayout()
grid.addWidget(QLabel(u'SSID', parent=self), 0, 0, 1, 1)
self.SSIDName = QLineEdit(parent=self)
self.SSIDName.setText("wifi")
grid.addWidget(self.SSIDName, 0, 1, 1, 1)
grid.addWidget(QLabel(u'password', parent=self), 1, 0, 1, 1)
self.WIFIpassword = QLineEdit(parent=self)
self.WIFIpassword.setText("password")
grid.addWidget(self.WIFIpassword, 1, 1, 1, 1)
grid.addWidget(QLabel(u'password', parent=self), 2, 0, 2, 2)
# Create ButtonBox, and the user confirms and cancels
buttonbox = QDialogButtonBox(parent=self)
buttonbox.setOrientation(Qt.Horizontal)
buttonbox.setStandardButtons(
QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
buttonbox.accepted.connect(self.accept)
buttonbox.rejected.connect(self.reject)
# Vertical layout, layout tables and buttons
layout = QVBoxLayout()
# Add the table layout you created earlier
layout.addLayout(grid)
# Put a space object to beautify the layout
spacerItem = QSpacerItem(
20, 48, QSizePolicy.Minimum, QSizePolicy.Expanding)
layout.addItem(spacerItem)
# ButtonBox
layout.addWidget(buttonbox)
self.setLayout(layout)
示例14: getText
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def getText(self):
"""
When the IP address cannot be automatically obtained by the user's computer,
the IP address will be manually entered by the user to create the server
:return: str The IP address entered by the user
"""
text, okPressed = QInputDialog.getText(
self, "not find ip ", "Your PC ip:", QLineEdit.Normal, "")
if okPressed and text != '':
print(text)
return text
示例15: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QLineEdit [as 别名]
def __init__(self, backgroundLayer = None):
super(LineEdit, self).__init__()
self.__font = "Arial"
self.__size = 15
self.__italic = False
self.__weight = TextFormatWeight.NORMAL
self.__preWidth = self.width
self.__preHeight = self.height
self.__preX = self.x
self.__preY = self.y
self.__preVisible = not self.visible
self.__textColor = "black"
self.__widgetFont = QtGui.QFont()
self.__widgetPalette = QtGui.QPalette()
self.lineEditWidget = QtWidgets.QLineEdit(stage.canvasWidget)
self.backgroundLayer = backgroundLayer
if not isinstance(self.backgroundLayer, DisplayObject):
self.backgroundLayer = Sprite()
self.backgroundLayer.graphics.beginFill("white")
self.backgroundLayer.graphics.lineStyle(2, "gray")
self.backgroundLayer.graphics.drawRect(0, 0, 200, 40)
self.backgroundLayer.graphics.endFill()
self.addChild(self.backgroundLayer)
self.__initWidget()
self.addEventListener(LoopEvent.ENTER_FRAME, self.__loop)