[Interest] Best practices for settings

André Somers andre at familiesomers.nl
Mon Nov 18 12:54:58 CET 2013

Tomasz Siekierda schreef op 17-11-2013 17:29:
> The settings class is a Singleton, and all options are accesible 
> through member variables (private + getters and setters, or public - 
> if you prefer). Although I personally believe Singletons are evil, 
> they can be useful - and this is one of the place where the benefits 
> outweight the problems.
Singletons really are evil indeed. However, Qt already provides one, and 
you might as well use it: QApplication. We usually make our settings 
object a member of our own QApplication-derived Application class. That 
way, it is available where needed, but we don't have another singleton.


More information about the Interest mailing list