[Qt-interest] Global variables "the Qt way"

Sensei senseiwa at gmail.com
Wed Jun 16 17:18:14 CEST 2010


Hi! I am in starting a new project, and I have a simple question about "global" variables, obviously not a C++ question! :)

What is the "Qt way" of handling global variable? 

I'll explain with an example. My application has a QApplication "global" variabel qApp, always accessible. What do you recommend I do for, let's say, a settings instance? This should be accessed by all (many) other classes, but I find that simply having a header defining variables with external storage, a little ugly.

I hope you can give me some hints!

Cheers!



More information about the Qt-interest-old mailing list