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


Python QSettings.UserScope方法代碼示例

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


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

示例1: init

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def init() -> None:
    """Initialize config storage not related to the main config."""
    global state

    try:
        state = StateConfig()
    except (configparser.Error, UnicodeDecodeError) as e:
        msg = "While loading state file from {}".format(standarddir.data())
        desc = configexc.ConfigErrorDesc(msg, e)
        raise configexc.ConfigFileErrors('state', [desc], fatal=True)

    # Set the QSettings path to something like
    # ~/.config/qutebrowser/qsettings/qutebrowser/qutebrowser.conf so it
    # doesn't overwrite our config.
    #
    # This fixes one of the corruption issues here:
    # https://github.com/qutebrowser/qutebrowser/issues/515

    path = os.path.join(standarddir.config(auto=True), 'qsettings')
    for fmt in [QSettings.NativeFormat, QSettings.IniFormat]:
        QSettings.setPath(fmt, QSettings.UserScope, path) 
開發者ID:qutebrowser,項目名稱:qutebrowser,代碼行數:23,代碼來源:configfiles.py

示例2: __init__

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def __init__(self):
        self.settings = QSettings(QSettings.IniFormat,
                                  QSettings.UserScope,
                                  'Azavea', 'RasterVision') 
開發者ID:azavea,項目名稱:raster-vision-qgis,代碼行數:6,代碼來源:settings.py

示例3: __init__

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def __init__(self):
        self.handle = QSettings(QSettings.IniFormat, QSettings.UserScope,
                                "fre-sch.github.com", "MHW-Editor-Suite") 
開發者ID:fre-sch,項目名稱:mhw_armor_edit,代碼行數:5,代碼來源:utils.py

示例4: open

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def open(self, t_filename=None):
        settings = QSettings(QSettings.IniFormat, QSettings.UserScope, "pySPM", "pySPM")
        if t_filename is None:
            home = QDir.cleanPath(os.getenv("HOMEPATH"))
            path = settings.value("lastPath", home)
            self.filename = QFileDialog.getOpenFileName(None, "Choose measurement file", path, "*.ita")[0]
        else:
            self.filename = t_filename
        check_file = QFileInfo(self.filename)
        self.setWindowTitle(check_file.fileName())
        if not check_file.exists() or  not check_file.isFile():
            return
        
        settings.setValue("lastPath", check_file.path())
        self.ita = pySPM.ITA(self.filename, readonly=False)
        self.t, self.S = self.ita.getSpectrum(time=True)
        self.sf, self.k0 = self.ita.get_mass_cal()
        self.mass = pySPM.utils.time2mass(self.t, self.sf, self.k0)
        self.spec = self.ax.plot(self.mass, self.S)[0]
        SatLevel = self.ita.size['pixels']['x']*self.ita.size['pixels']['y']*self.ita.Nscan
        self.sat_level = self.ax.axhline(SatLevel, color='r')
        if 'pySPM' in self.ita.root.goto("MassScale"):
            self.MassCal = []
            N = self.ita.root.goto("MassScale/pySPM/N").get_ulong()
            for i in range(N):
                elt = self.ita.root.goto("MassScale/pySPM/"+str(i)+"/elt").value.decode('utf8')
                mass = self.ita.root.goto("MassScale/pySPM/"+str(i)+"/mass").get_double()
                time = self.ita.root.goto("MassScale/pySPM/"+str(i)+"/time").get_double()
                self.MassCal.append(dict(elt=elt, mass=mass, time=time))
        else:
            self.MassCal = []
            for x in self.ita.root.goto("MassScale/calib"):
                if x.name == 'assign':
                    self.MassCal.append({'elt':x.get_string()})
                if x.name == 'mcp':
                    mcp = struct.unpack("<10d", x.value)
                    self.MassCal[-1]['time'] = mcp[0]
                    self.MassCal[-1]['mass']  =  mcp[1]
        self.DoMassCal() 
開發者ID:scholi,項目名稱:pySPM,代碼行數:41,代碼來源:spectra.py

示例5: __get_qt_settings

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def __get_qt_settings():
    global __qt_settings

    try:
        __qt_settings.fileName()
    except:
        __qt_settings = QSettings(QSettings.IniFormat, QSettings.UserScope, 'urh', 'urh')

    return __qt_settings 
開發者ID:jopohl,項目名稱:urh,代碼行數:11,代碼來源:settings.py

示例6: __init__

# 需要導入模塊: from PyQt5.QtCore import QSettings [as 別名]
# 或者: from PyQt5.QtCore.QSettings import UserScope [as 別名]
def __init__(self, name: str):
        super().__init__()
        self.__enabled = Qt.Unchecked
        self.name = name
        self.plugin_path = ""
        self.description = ""
        self.__settings_frame = None
        self.qsettings = QSettings(QSettings.IniFormat, QSettings.UserScope, "urh", self.name + "-plugin") 
開發者ID:jopohl,項目名稱:urh,代碼行數:10,代碼來源:Plugin.py


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