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. http://doc.trolltech.com/3.2/qsettings.html
Since all of this sound like the TDirectory I thought doing something like:

    QSettings settings;
    settings.setPath( "MyCompany.com", "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

Lutz

Hi,

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.

Cheers,
Philippe.

Hi Lutz,
to accomplish something like this try
root.cern.ch/root/htmldoc/TEnv.html

Regards. Valeriy

Hi Valeriy,

Thanks this exactly what I was looking for.

cheers,

Lutz