Z
Z
ZhukovMisha2019-06-28 17:03:58
Qt
ZhukovMisha, 2019-06-28 17:03:58

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

3 answer(s)
V
Vitaly, 2019-06-28
@ZhukovMisha

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.

E
Evgeny Petryaev, 2019-06-28
@Gremlin92

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.

V
vanyamba-electronics, 2019-06-28
@vanyamba-electronics

Read/write configuration file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question