QSettings - where is the location of the ini file?

前端 未结 9 2046
悲哀的现实
悲哀的现实 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:20

    In linux you can use this snippet or insert this lines into your main code for find location of your file with python.

    from PyQt5.QtCore import QSettings
    
    settings = QSettings("Organization Name", "App name")
    print(QSettings.fileName(settings))
    

    It should return an output like this.

    /$HOME/.config/Organization Name/App name.conf

    Source

提交回复
热议问题