Wow, that was easy, exactly what I needed.
Thanks loads for the help.
Wow, that was easy, exactly what I needed.
Thanks loads for the help.
Qt has a lot of this already done. For application settings, for example, you can use the QSettings class.
"The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry
December (20th May 2007)
To add to that there are many that consider using conditional compilation to be "evil". So you should avoid this if at all possible. In particular Qt has a number of things that hide differences like this in high level libraries. QSettings is an example. So using QSettings Qt will take care of using the registry on Windows, Carbon on Mac and will use a text file on Linux/Unix... for user setting and your code for all of these platforms will be the same or very nearly the same.
So if you find yourself thinking that you will need to use conditional compilation to handle something ask here first and in most cases someone will be able to tell you which Qt objects to use so that you can avoid this. In the end your code will be simpler and easier to understand and maintain. This is not always possible but you should only have to use conditionals under a very limited number of cases and most of those will involve things that are at a very low level (typically hardware level stuff).
Bookmarks