How to hide a window and show another window
-
@LT-K101
OK now that you have sorted theimportstatement.So you have a Python file with a top-level statement
self.hide()as you show, nothing else in the file other than you show, and this work as Python code? Could you explain how that works, please, I am intrigued/wish to learn?
@JonB There is an sql query which after execution it hides the current window and show the login window
cur.execute(''' UPDATE users SET user_password ='" + encrytpass + "',access_status='existing' WHERE id_no ='"+username2+"' ''') con.commit() QMessageBox.information(self, "Success", "Password Saved Successfully") self.hide() self.loginwindow = Login.LoginWindow() self.loginwindow.show() -
@JonB There is an sql query which after execution it hides the current window and show the login window
cur.execute(''' UPDATE users SET user_password ='" + encrytpass + "',access_status='existing' WHERE id_no ='"+username2+"' ''') con.commit() QMessageBox.information(self, "Success", "Password Saved Successfully") self.hide() self.loginwindow = Login.LoginWindow() self.loginwindow.show() -
@LT-K101 said in How to hide a window and show another window:
@JonB Sorry my bad. Is it possible to encrypt sql database before I make a .exe?
Hi,
How would you decrypt and use it afterwards ?
In any case, since you are not using Qt's SQL module, you should check pysqlcipher3,
On a side note, the way you are building your queries opens for SQL injection attacks.
-
@LT-K101 said in How to hide a window and show another window:
@JonB Sorry my bad. Is it possible to encrypt sql database before I make a .exe?
Hi,
How would you decrypt and use it afterwards ?
In any case, since you are not using Qt's SQL module, you should check pysqlcipher3,
On a side note, the way you are building your queries opens for SQL injection attacks.
-
@LT-K101 said in How to hide a window and show another window:
Is it possible to encrypt sql database before I make a .exe?
No idea what this means. Please try to give enough detail in a question to allow us to understand :)
-
@SGaist What is the best practice for building sql queries, I thought what I'm doing is the standard way of doing things. Please can you enlighten me more on this please. Thank you.
@LT-K101 said in How to hide a window and show another window:
What is the best practice for building sql queries, I thought what I'm doing is the standard way of doing things. Please can you enlighten me more on this please. Thank you.
You are choosing to use Python library instead of Qt library for all your SQL access, so this is not a Qt question. Look up "SQL injection attack" for your Python SQL library, it perhaps will explain and tell you to use "bound variables" in your queries rather than your attempt to interpolate arbitrary string variables into your string.
-
@JonB What I mean is how to protect my database file on a computer's
C:// drive?Because I don't want the database file to be tempered with by an authorized persons.@LT-K101 said in How to hide a window and show another window:
@JonB What I mean is how to protect my database file on a computer's C:// drive ?Because I don't want the database file to be tempered with by an authorized persons.
More or less, you cannot. You may be able to restrict who can connect via SQLite to it (e.g. by not divulging password), but (unless you take some network file protection measures under NTFS, unlikely) you cannot stop a local user from deleting/altering a file on
C:.