tags:

views:

76

answers:

2

is there is a config file in qt?

+2  A: 

If you mean the config file for compiling, then it's project (pro) file. If you wanna store some settings for you own program, you can try QSettings. Of course, you can write a class to read/write config file organized by yourself.

+1  A: 

If you're trying to store settings for your own application in a config file, I've used QSettings like this before:

QSettings settings(QString("configs/config.ini"), QSettings::IniFormat);
QString someValue = settings.value("some/config/key", "default value if unset").toString(); // settings.value() returns QVariant

And exmaple configs/config.ini file:

[some]
config/key=whatever string here
Dan