本文整理匯總了Python中PythonQt.QtCore.QSettings.remove方法的典型用法代碼示例。如果您正苦於以下問題:Python QSettings.remove方法的具體用法?Python QSettings.remove怎麽用?Python QSettings.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PythonQt.QtCore.QSettings
的用法示例。
在下文中一共展示了QSettings.remove方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: startAuthenticationProcess
# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
def startAuthenticationProcess(self):
if self.settingsDialog.group_account.input_url.text and self.settingsDialog.group_account.input_username.text and self.settingsDialog.group_account.input_password.text:
self.saveSettings()
self.loadSettings()
if match(self.url, "URI"):
try:
request = requests.get(self.url, timeout=3);
if request.status_code == 200:
oc = owncloud.Client(self.url)
oc.login(self.username, self.password)
self.connectStatus = "true"
self.saveSettings()
self.updateUi()
except requests.exceptions.RequestException as e:
QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The specified Server URL is invalid!")
settings = QSettings()
settings.remove("connect-status")
self.saveSettings()
self.updateUi()
except Exception as e:
errorMessage = self.formatConnectionError(e.message)
if errorMessage == "401":
self.settingsDialog.group_connection.widget_status.label_status.setText("Invalid")
else:
QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", errorMessage)
else:
QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The specified Server URL is invalid!")
else:
missingFields = ""
fieldText = "field"
if not self.settingsDialog.group_account.input_url.text:
missingFields = "\"Server URL\""
if not self.settingsDialog.group_account.input_username.text:
if missingFields == "":
missingFields = "\"Username\""
else:
missingFields = missingFields + " and \"Username\""
fieldText = "fields"
if not self.settingsDialog.group_account.input_password.text:
if missingFields == "":
missingFields = "\"Password\""
else:
missingFields = missingFields.replace(" and", ",") + " and \"Password\""
fieldText = "fields"
QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The " + missingFields + " " + fieldText + " must be filled in!")
示例2: logout
# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
def logout(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("dropbox")
settings.remove("access-token")
settings.remove("user-id")
settings.remove("display-name")
settings.endGroup()
settings.endGroup()
self.loadSettings()
self.updateUi()
示例3: logOut
# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
def logOut(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("imgur")
settings.remove("access-token")
settings.remove("refresh-token")
settings.remove("username")
settings.setValue("anonymous", "true")
settings.endGroup()
settings.endGroup()
self.loadSettings()
self.updateUi()