简体   繁体   English

在GUI应用程序中保存负载

[英]Save load in gui application

I try to make custom savefile for my GUI application. 我尝试为我的GUI应用程序创建自定义保存文件。 In saving method I have something like this to save enabled status of all checkboxes. 在保存方法中,我有类似这样的内容可以保存所有复选框的启用状态。

enabledparams = [checkbox.isEnabled() for checkbox in self.tabParameters.findChildren(QtGui.QCheckBox)]

In loading method I should do this in backward sense, so to make enabled status from the saved 在加载方法中,我应该向后进行此操作,以便从已保存的状态中启用状态

enabledparams

How to do this effectively in pythonic sense with minimum of code? 如何以最少的代码在pythonic意义上有效地做到这一点? I have more of these cases for checked state of the boxes and also for a lot of spinboxes and textboxes. 对于框的选中状态,以及更多的旋转框和文本框,我有更多的此类情况。

Thank you in advance 先感谢您

the QSettings module of Qt would be useful to you. Qt的QSettings模块对您很有用。 It provides functionality to save and load application settings. 它提供了保存和加载应用程序设置的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM