本文整理匯總了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()