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