Answer the question
In order to leave comments, you need to log in
How to make the window open once and only once (as during registration)?
I want to do the same as when registering.
That is, the window that opened once (when the application was first opened) and did not open the next time
Answer the question
In order to leave comments, you need to log in
Qt has a QSettings class . It is designed to store application settings. You can use it, the documentation has examples of use. The algorithm is as follows:
1) Check whether there is some value in the settings
2) If there is, do not show the window. If not, then show the window and set the value.
If you really need a registration mechanism, then everything is somewhat more complicated.
Create a file with zero, for example, read a number from the file, if it is zero, create a window, show a message and write a unit instead of zero to the file, then when you open it with a unit, the window will not be shown, you can then encrypt and decrypt this file so that it is not ruled from notepad and not set to zero. You can store the same zero in the database and then write a one in its place, etc. d.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question