Sorry for hijacking this post. But I really need some help
This is the code which I use to control my .ui file
So there is this TextEdit field which by Default shows "Enter your email" but it must go blank when the user clicks on it.
I am not able to understand how to incorporate the above code.
Please help!
import sys
from PyQt4 import QtCore, QtGui, uic
from Email import encrypt_email
from Email import decrypt_email
qtCreatorFile = "rsegui.ui" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class MyApp(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.encrypt_and_send.clicked.connect(self.EncryptEmail)
self.decrypt.clicked.connect(self.DecryptEmail)
def focusInEvent(self, event):
self.clear()
QTextEdit.focusInEvent(self, event)
def newuser_cleartext(self):
self.newuser.clear()
def EncryptEmail(self):
user=str(self.newuser.toPlainText())
sender = str(self.sender.toPlainText())
receiver = str(self.receiver.toPlainText())
receivers = receiver.split(';')
subject = str(self.subject.toPlainText())
message = str(self.message.toPlainText())
password = str(self.password.toPlainText())
encrypt_email(user,sender,receivers,subject,message,password)
def DecryptEmail(self):
email = str(self.sender_2.toPlainText())
message = str(self.message_2.toPlainText())
self.decrypted.setText(decrypt_email(email,message))
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
window = MyApp()
window.show()
sys.exit(app.exec_())