QSettings - where is the location of the ini file?

前端 未结 9 2068
悲哀的现实
悲哀的现实 2021-02-03 21:45

I\'m using QSettings to store some data as ini file in Windows. I want to see the ini file, but I don\'t know what is the location of the ini file.

This is

9条回答
  •  悲哀的现实
    2021-02-03 22:03

    To print out the exact location of your settings file use method fileName method of QSettings class.

    QSettings settings("folderName", "fileName");
    qDebug() << settings.fileName();
    

    Console output looks then like:

    /home/user/.config/folderName/fileName.conf
    

提交回复
热议问题