當前位置: 首頁>>代碼示例>>Python>>正文


Python QSettings.setDefaultFormat方法代碼示例

本文整理匯總了Python中PyQt4.Qt.QSettings.setDefaultFormat方法的典型用法代碼示例。如果您正苦於以下問題:Python QSettings.setDefaultFormat方法的具體用法?Python QSettings.setDefaultFormat怎麽用?Python QSettings.setDefaultFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt4.Qt.QSettings的用法示例。


在下文中一共展示了QSettings.setDefaultFormat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __new__

# 需要導入模塊: from PyQt4.Qt import QSettings [as 別名]
# 或者: from PyQt4.Qt.QSettings import setDefaultFormat [as 別名]
 def __new__(cls, clear_cache = False):
     if not cls._instance:
         cls._instance = super(Settings, cls).__new__(cls)
         cls._instance.signals = Settings.signals()
         QSettings.setDefaultFormat(QSettings.IniFormat)
         log.DEBUG("saving settings in file %s" %(QSettings().fileName()));
         cls._instance._settings = QSettings()
         cls._defaults = {
              Settings.DOTA_PATH_KEY: dota_path_default,
              Settings.STEAM_PATH_KEY: steam_path_default,
          }
     if clear_cache:
         cls._instance._cache = {}
     return cls._instance
開發者ID:OligarchButterfly,項目名稱:D2ModdinPyClient,代碼行數:16,代碼來源:settings.py

示例2: ConfigProxy

# 需要導入模塊: from PyQt4.Qt import QSettings [as 別名]
# 或者: from PyQt4.Qt.QSettings import setDefaultFormat [as 別名]
    # This option is no longer used. It remains for compatibility with upgrades
    # so the value can be migrated
    c.add_opt('tag_browser_hidden_categories', default=set(),
            help=_('tag browser categories not to display'))

    c.add_opt
    return ConfigProxy(c)

config = _config()
# }}}

QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, config_dir)
QSettings.setPath(QSettings.IniFormat, QSettings.SystemScope,
        config_dir)
QSettings.setDefaultFormat(QSettings.IniFormat)

# Turn off DeprecationWarnings in windows GUI
if iswindows:
    import warnings
    warnings.simplefilter('ignore', DeprecationWarning)

def available_heights():
    desktop  = QCoreApplication.instance().desktop()
    return map(lambda x: x.height(), map(desktop.availableGeometry, range(desktop.numScreens())))

def available_height():
    desktop  = QCoreApplication.instance().desktop()
    return desktop.availableGeometry().height()

def max_available_height():
開發者ID:piewsook,項目名稱:calibre,代碼行數:32,代碼來源:__init__.py


注:本文中的PyQt4.Qt.QSettings.setDefaultFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。