Effective use of QSettings

Viewed 289

I have quite a lot of settings in my program, about 3000. They shouldn't be read at once upon the program's start, rather in 10 different places in the program when a need arises. I wonder what is the most efficient way in terms of performance/memory usage to do this:

1 To have one 'global' QSettings instance always open;

2 To have some local QSettings instances in all the places where it is needed;

3 To read them once and to store them in memory for future use.

Or, probably, I am over-analyzing here and it doesn't really matter?

1 Answers

I know this question is 5 years old, but I went into the source code for Qt and found that the QSettings constructor does literally nothing. It's just {}. All of the load goes on the functions for reading and writing data.

Related