本文整理汇总了Python中PyQt5.QtWidgets.QLineEdit.Password方法的典型用法代码示例。如果您正苦于以下问题:Python QLineEdit.Password方法的具体用法?Python QLineEdit.Password怎么用?Python QLineEdit.Password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QLineEdit
的用法示例。
在下文中一共展示了QLineEdit.Password方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ask_for_password
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def ask_for_password(username, host, message=None):
if not SshPassCache.parent_window:
raise Exception('SshPassCache not initialized')
def query_psw(msg):
password, ok = QInputDialog.getText(SshPassCache.parent_window, 'Password Dialog',
msg, echo=QLineEdit.Password)
return password, ok
if not message:
message = 'Enter password for ' + username + '@' + host + ':'
if threading.current_thread() != threading.main_thread():
password, ok = WndUtils.call_in_main_thread(query_psw, message)
else:
password, ok = query_psw(message)
if not ok:
raise CancelException
return password
示例2: initUI
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def initUI(self):
self.setWindowTitle('Confirmation for Password')
self.confirmLayout = QGridLayout()
details = {'From':'From','Password':'Password'}
self.frm = QLabel('<b>%s</b>'%details['From'])
self.sender = QLabel('<b>%s</b>'%self.sender)
self.password = QLabel('<b>%s</b>'%details['Password'])
self.passwordEdit = QLineEdit()
self.passwordEdit.setEchoMode(QLineEdit.Password)
self.send = QPushButton('SEND')
self.confirmLayout.addWidget(self.frm,1,0)
self.confirmLayout.addWidget(self.sender,1,1)
self.confirmLayout.addWidget(self.password,2,0)
self.confirmLayout.addWidget(self.passwordEdit,2,1)
self.confirmLayout.addWidget(self.send,3,0)
self.setLayout(self.confirmLayout)
self.setGeometry(150,150,400,200)
示例3: update_key_controls_state
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def update_key_controls_state(self):
self.edtOwnerKey.setEchoMode(QLineEdit.Normal if self.btnShowOwnerPrivateKey.isChecked() or
self.edit_mode else QLineEdit.Password)
self.edtOperatorKey.setEchoMode(QLineEdit.Normal if self.btnShowOperatorPrivateKey.isChecked() or
self.edit_mode else QLineEdit.Password)
self.edtVotingKey.setEchoMode(QLineEdit.Normal if self.btnShowVotingPrivateKey.isChecked() or
self.edit_mode else QLineEdit.Password)
self.update_dynamic_labels()
示例4: on_btnShowOwnerPrivateKey_toggled
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def on_btnShowOwnerPrivateKey_toggled(self, checked):
self.edtOwnerKey.setEchoMode(QLineEdit.Normal if checked else QLineEdit.Password)
self.update_key_controls_state()
示例5: on_btnShowOperatorPrivateKey_toggled
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def on_btnShowOperatorPrivateKey_toggled(self, checked):
self.edtOperatorKey.setEchoMode(QLineEdit.Normal if checked else QLineEdit.Password)
self.update_key_controls_state()
示例6: on_btnShowVotingPrivateKey_toggled
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def on_btnShowVotingPrivateKey_toggled(self, checked):
self.edtVotingKey.setEchoMode(QLineEdit.Normal if checked else QLineEdit.Password)
self.update_key_controls_state()
示例7: _showTuShareProToken
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def _showTuShareProToken(self):
text = self._tuShareProTokenPushButton.text()
if text == 'TuSharePro token':
self._tuShareProTokenPushButton.setText('*TuSharePro token*')
self._tuShareProTokenLineEdit.setEchoMode(QLineEdit.Password)
else:
self._tuShareProTokenPushButton.setText('TuSharePro token')
self._tuShareProTokenLineEdit.setEchoMode(QLineEdit.Normal)
示例8: passwordCollection
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def passwordCollection(self):
details = {'Sender':self.senderEdit.text(),'Receiver':self.receiverEdit.text(),'Subject':self.subjectEdit.text(),'Message':self.messageEdit.toPlainText()}
self.passwordText = self.confirmWindow.passwordEdit.text()
details['Password'] = self.passwordText
reply = shootMail(details)
if reply == 'Success':
QMessageBox.about(self, "Successful","Mail Sent Succesfully")
else:
QMessageBox.about(self,"Warning Error Occured",reply)
示例9: __init__
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def __init__(self, *args, **kwargs):
QWidget.__init__(self, *args, **kwargs)
self.setLayout(QFormLayout())
self.enablebox = QCheckBox()
self.enablebox.stateChanged.connect(self._enable_cb_statechange)
self.hostinput = QLineEdit()
self.portinput = QLineEdit()
self.credsbox = QCheckBox()
self.credsbox.stateChanged.connect(self._login_cb_statechange)
self.credsbox.setCheckState(0)
self.usernameinput = QLineEdit()
self.passwordinput = QLineEdit()
self.passwordinput.setEchoMode(QLineEdit.Password)
self.socksbox = QCheckBox()
self.confirmbutton = QPushButton("Confirm")
self.confirmbutton.clicked.connect(self._confirm_entry)
self.layout().addRow(QLabel("Use Proxy"), self.enablebox)
self.layout().addRow(QLabel("Host"), self.hostinput)
self.layout().addRow(QLabel("Port"), self.portinput)
self.layout().addRow(QLabel("Use Login"), self.credsbox)
self.layout().addRow(QLabel("Username"), self.usernameinput)
self.layout().addRow(QLabel("Password"), self.passwordinput)
self.layout().addRow(QLabel("Use SOCKS"), self.socksbox)
self.layout().addRow(QLabel(""), self.confirmbutton)
self._set_enabled(False)
self._set_login_enabled(False)
示例10: initUI
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def initUI(self):
# =================== WIDGET QLINEEDIT =====================
self.lineEdit = QLineEdit(self)
# ================== FUNCIONES PÚBLICAS ==================
self.lineEdit.setGeometry(20, 20, 360, 24)
self.lineEdit.setText("Andres Niño")
# self.lineEdit.setAlignment(Qt.AlignLeft)
# self.lineEdit.setClearButtonEnabled(True)
# self.lineEdit.setCursorPosition(6)
# self.lineEdit.home(True)
# self.lineEdit.end(True)
# self.lineEdit.setEchoMode(QLineEdit.Password)
# self.lineEdit.setFrame(False)
# self.lineEdit.setMaxLength(2)
# self.lineEdit.setPlaceholderText("Andres Niño")
# self.lineEdit.setReadOnly(True)
# self.lineEdit.setSelection(3, 2)
# self.lineEdit.selectAll()
# self.lineEdit.deselect()
# self.lineEdit.setTextMargins(10, 0, 6, 1)
# self.lineEdit.setInputMask(">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#")
# self.lineEdit.setValidator(QRegExpValidator(QRegExp("[0-9]+")))
# print(self.lineEdit.text())
fuente = QFont()
fuente.setPointSize(10)
fuente.setCapitalization(QFont.Capitalize)
self.lineEdit.setFont(fuente)
# ======================= SEÑALES ========================
# self.lineEdit.returnPressed.connect(lambda: print("Se presiono la tecla Enter..."))
# self.lineEdit.textChanged.connect(lambda: print("El texto cambio..."))
# self.lineEdit.textEdited.connect(lambda: print("El texto cambio..."))
# ================================================================
示例11: __init__
# 需要导入模块: from PyQt5.QtWidgets import QLineEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QLineEdit import Password [as 别名]
def __init__(self, parent=None):
super(Form,self).__init__(parent)
self.LOGGEDIN = False
self.setWindowIcon(QIcon("assets/logo.png"))
self.setWindowTitle("BeaconGraph")
#self.setWindowFlags(Qt.FramelessWindowHint | Qt.Dialog)
self.logo = QPixmap('assets/logo300.png')
self.picLabel = QLabel(self)
self.picLabel.setPixmap(self.logo)
self.picLabel.setAlignment(Qt.AlignCenter)
self.uri = QLineEdit(self)
self.uri.setText("bolt://localhost:7687")
self.QUriLabel = QLabel("DB URI")
self.username = QLineEdit(self)
self.username.setPlaceholderText("Neo4j Username")
self.QUserLabel = QLabel("USERNAME")
self.password = QLineEdit(self)
self.password.setPlaceholderText("Neo4j Password")
self.password.setEchoMode(QLineEdit.Password)
self.QPasswordLabel = QLabel("PASSWORD")
self.btn_Submit = QPushButton("LOGIN")
self.setStyleSheet(qss)
self.resize(400, 500)
logoLayout = QBoxLayout(QBoxLayout.TopToBottom)
logoLayout.addWidget(self.picLabel)
layout = QFormLayout()
layout.addRow(self.QUriLabel,self.uri)
layout.addRow(self.QUserLabel,self.username)
layout.addRow(self.QPasswordLabel,self.password)
layout.addRow(self.btn_Submit)
logoLayout.addLayout(layout)
self.setLayout(logoLayout)
self.btn_Submit.clicked.connect(self.Submit_btn)