本文整理汇总了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)
示例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')
示例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")
示例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()
示例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
示例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")