开发者

When should i save settings with QSettings in a class?

开发者 https://www.devze.com 2023-04-12 07:14 出处:网络
I used to save settings in closeEvent , now i found that\'s bit of flaw , because when you close a window , that function开发者_如何学Go will be called as well. ( my app have a system tray , and hide

I used to save settings in closeEvent , now i found that's bit of flaw , because when you close a window , that function开发者_如何学Go will be called as well. ( my app have a system tray , and hide to system tray ability )

So when should i save the settings with QSettings ? I shouldn't be calling this in destruction function , right ?


It's definitely fine to use QSettings in destructors. I've done that for years and not had any problems.

0

精彩评论

暂无评论...
验证码 换一张
取 消