Unsolved how can i parser the .ini file?
-
@J.Hilk
http://doc.qt.io/qt-5/qsettings.html#setPathI think i can set the path myself by UserScope.
But It has to be under /home. -
Either you have a hard time understanding what answeres are give to you, or you're messing with us ;-)
So if my INI file is not at the default path i should move it in to the right path?
That's a definite maybe.
Can't i give the direct path if i am not in the default path?
Yes:
@J.Hilk said in [how can i parser the .ini file?](/topic/77013/how-can-i-parser-the-ini-
QSettings settings("c:/Folder1/Folder2/..../my_ini_file.ini", QSettings::IniFormat);
and
@jsulm said in how can i parser the .ini file?:
QSettings settings("/PATH_TO_MY_INI_FILE/my_ini_file.ini", QSettings::IniFormat);
Just provide the complete path to the file, that's all.
-
-
@victor-wang
the;
should not at the end offoreach
statement, or it will do nothing and finish theforeach
statement, just likefor
statement.you should write
qDebug()
notqDebug
, you forget the parentheses. -
@Flotisable
Sorry, i got this :)Besides, i got a question.
Can i only read the key which the value is true? -
@victor-wang
I think you have to write some code to test it, just read the key if it pass the test. -
@Flotisable
Can i put value into array?
If it can, how can i do it? -
@victor-wang
I think any data can be put into array, but what exactly you want ? -
@Flotisable
It is my code hereI wanna put childkey and values into array.
Then compare them.
But i don't know how to do it.
Please Help! -
@victor-wang
if you just want to test if the value is true, I think you can do it in theforeach
statement, likeforeach( const QString &childkey, childkeys ) if( settings.value( childkey ).toString() == "true" ) { // do what you want }