本文整理汇总了Python中mcedit2.util.settings.Settings.setValue方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.setValue方法的具体用法?Python Settings.setValue怎么用?Python Settings.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mcedit2.util.settings.Settings
的用法示例。
在下文中一共展示了Settings.setValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setBinding
# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import setValue [as 别名]
def setBinding(self, button, key, modifiers):
self.button = button
self.key = key
self.modifiers = modifiers
if self.settingsKey is not None:
settings = Settings()
prefix = "keybindings/"
settings.setValue(prefix + self.settingsKey + "/button", self.button)
settings.setValue(prefix + self.settingsKey + "/key", self.key)
settings.setValue(prefix + self.settingsKey + "/modifiers", int(self.modifiers))
示例2: ChangeBinding
# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import setValue [as 别名]
def ChangeBinding(shortcutName, shortcutString):
settings = Settings()
settings.setValue("keybinding/" + shortcutName, shortcutString)
示例3: saveSettings
# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import setValue [as 别名]
def saveSettings(self):
settings = Settings()
settings.setValue("mainwindow/state", self.saveState())
settings.setValue("mainwindow/geometry", self.saveGeometry())
settings.sync()