我无法在任何地方找到它,也无法找到有关如何安装它的文章。
答案 0 :(得分:1)
QSettings
或查看this book
中的第103页 <强>更新强>
我刚刚意识到您需要在PC上安装import json
class MyWidget(QWidget):
def __init__(self, parent):
super(MyWidget, self).__init__(parent)
self.myvalue = 10
self.mylist = [1,2,3]
self.restoreSettings()
def closeEvent(self, event):
self.saveSettings()
super(MyWidget, self).closeEvent(event)
def saveSettings(self):
settings = QSettings('myorg', 'myapp')
settings.setValue('myvalue', self.myvalue)
settings.setValue('mylist', json.dumps(self.mylist))
def restoreSettings(self):
settings = QSettings('myorg', 'myapp')
self.myvalue = settings.value('myvalue', self.myvalue)
try:
self.mylist = json.loads(settings.value('mylist', None))
except (ValueError, TypeError):
pass
或从C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Web Services\bin
抓取它。