Momergil
27th July 2011, 19:49
Hello!
I would like to know if there is a Qt or else C++ function that returns the system of the computer in which my Qt software would be running (system = Linux, Windows, Mac, etc.).
To give a context, the software I'm creating needs to create .txt achives and I want to use QDir to create this .txt files always in the same directory. But the best place for doing that would change from system to system, so, for example, if my software will be running by someone in Windows, it will create the space for the txt in "Programs and Settings", while if it is being running in Ubuntu, the txt will be created in /home. So I need to create a method in my software that recognizes which system is being used to create the appropriate path where the txts will be saved.
Does anybody know a function for that?
Thanks!
Martin/Momergil
I would like to know if there is a Qt or else C++ function that returns the system of the computer in which my Qt software would be running (system = Linux, Windows, Mac, etc.).
To give a context, the software I'm creating needs to create .txt achives and I want to use QDir to create this .txt files always in the same directory. But the best place for doing that would change from system to system, so, for example, if my software will be running by someone in Windows, it will create the space for the txt in "Programs and Settings", while if it is being running in Ubuntu, the txt will be created in /home. So I need to create a method in my software that recognizes which system is being used to create the appropriate path where the txts will be saved.
Does anybody know a function for that?
Thanks!
Martin/Momergil