Something similar to QSettings?

Hello Rooters,

this is a more general question about how to save settings of a program not using the ::Streamer() function the dictionary creates for you. In QT there is a class called QSettings which allows you to save the settings you want to save to a given path.
Since all of this sound like the TDirectory I thought doing something like:

    QSettings settings;
    settings.setPath( "", "MyApplication" );

    QString bgColor = settings.readEntry( "/colors/background", "white" );
    int width = settings.readNumEntry( "/geometry/width", 640 );
    // ...
    settings.writeEntry( "/colors/background", bgColor );
    settings.writeEntry( "/geometry/width", width );

can be done with TDictionary and TFile. Does anybody have any suggestions on how to accomplish something like this? Do you have any reference. I have been carefully going through TFile and TDictionary describtion, but there was not obvious solution for me.

Thank you



Read carefuly the chapter in the User’s Guide on I/O.
Most likely in your case, you would need to generate a dictionary for QSettings and compile, link and load this dictionary.


Hi Lutz,
to accomplish something like this try

Regards. Valeriy

Hi Valeriy,

Thanks this exactly what I was looking for.