Vous pouvez ajouter le module suivant comme ControlPasswordText.py
dans votre dossier de projet:
from pysettings import conf
from pyforms.Controls import ControlText
from PyQt4.QtGui import QLineEdit
class ControlPasswordText(ControlText):
def __init__(self, *args, **kwargs):
super(ControlPasswordText, self).__init__(*args, **kwargs)
self.form.lineEdit.setEchoMode(QLineEdit.Password)
Et voici comment vous l'utiliser:
import pyforms
from pyforms import BaseWidget
from pyforms.Controls import ControlText
from pyforms.Controls import ControlButton
# Importing the module here
from ControlPasswordText import ControlPasswordText
class SimpleExample1(BaseWidget):
def __init__(self):
super(SimpleExample1,self).__init__('Simple example 1')
#Definition of the forms fields
self._username = ControlText('Username')
# Using the password class
self._password = ControlPasswordText('Password')
#Execute the application
if __name__ == "__main__": pyforms.startApp(SimpleExample1)
Résultat:
Veuillez mettre à jour votre question pour être une question. Ce que vous demandez de l'aide n'est pas clair. Veuillez consulter les directives ici: https://stackoverflow.com/help/how-to-ask et reformuler votre question. – Ben