当前位置: 首页>>代码示例>>Python>>正文


Python QDesktopServices.openUrl方法代码示例

本文整理汇总了Python中PythonQt.QtGui.QDesktopServices.openUrl方法的典型用法代码示例。如果您正苦于以下问题:Python QDesktopServices.openUrl方法的具体用法?Python QDesktopServices.openUrl怎么用?Python QDesktopServices.openUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PythonQt.QtGui.QDesktopServices的用法示例。


在下文中一共展示了QDesktopServices.openUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: startAuthenticationProcess

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
	def startAuthenticationProcess(self):
		self.settingsDialog.group_account.widget_authorize.button_authenticate.setEnabled(False)
		self.flow = dropbox.oauth.DropboxOAuth2FlowNoRedirect('sfacmqvdb9dn66r', 'hx8meda636xgsox')
		authorize_url = QUrl(self.flow.start())
		QDesktopServices.openUrl(authorize_url)
		try:
			code = raw_input("Enter the authorization code from the dropbox website:")
		except NameError:
			code = input("Enter the authorization code from the dropbox website:")
		if code:
			try:
				oauth2_result = self.flow.finish(code)
				self.access_token = oauth2_result.access_token
				self.client = dropbox.Dropbox(self.access_token)
				account = self.client.users_get_current_account()
				self.user_id = account.account_id
				self.display_name = account.name.display_name
			except dropbox.auth.AccessError:
				if "win" in sys.platform: #Workaround for crash on windows
					self.parentWidget.hide()
					self.settingsDialog.hide()
				QMessageBox.critical(self.settingsDialog, "Failed to authenticate", "Failed to authenticate with Dropbox. Wrong code?")
				if "win" in sys.platform:
					self.settingsDialog.show()
					self.parentWidget.show()
		self.saveSettings()
		self.updateUi()
开发者ID:olav-st,项目名称:screencloud-plugins,代码行数:29,代码来源:main.py

示例2: SearchFinished

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
 def SearchFinished():
     data = json.loads(str(reply.readAll()))
     feed = data["feed"]
     try:
         print feed["entry"][0]["media$group"]["media$player"][0]["url"]
         youtube_url = feed["entry"][0]["media$group"]["media$player"][0]["url"]
         QDesktopServices.openUrl(QUrl.fromEncoded(str(youtube_url)))
     except Exception, e:
         print e
开发者ID:ximion,项目名称:Clementine-LibDanceTag,代码行数:11,代码来源:youtube.py

示例3: startAuthenticationProcess

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
	def startAuthenticationProcess(self):
		self.saveSettings()
		self.loadSettings()
		self.settingsDialog.group_account.button_authenticate.setEnabled(False)
		self.settingsDialog.group_account.label_code.setEnabled(True)
		self.settingsDialog.group_account.input_code.setEnabled(True)
		self.settingsDialog.group_account.button_code.setEnabled(True)
		auth_url = self.imgur.authorization_url('pin')
		QDesktopServices.openUrl(QUrl(auth_url))
		self.settingsDialog.group_account.button_code.connect("clicked()", self.pinEntered)
开发者ID:Nothing4You,项目名称:screencloud-plugins,代码行数:12,代码来源:main.py

示例4: startAuthenticationProcess

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
	def startAuthenticationProcess(self):
		self.saveSettings()
		self.loadSettings()
		auth_url = self.imgur.authorization_url('pin')
		QDesktopServices.openUrl(QUrl(auth_url))
		pin = raw_input("Enter PIN from imgur website:")
		if pin:
			try:
				self.access_token, self.refresh_token = self.imgur.exchange_pin(pin)
			except KeyError as e:
				QMessageBox.critical(self.settingsDialog, "Imgur key error", "Failed to exchange pin. " + e.message)
		self.access_token, self.username = self.imgur.refresh_access_token()
		self.saveSettings()
		self.updateUi()
开发者ID:Rocik,项目名称:screencloud-plugins,代码行数:16,代码来源:main.py

示例5: Homepage

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
 def Homepage(self):
   QDesktopServices.openUrl(self.HOMEPAGE_URL)
开发者ID:ximion,项目名称:Clementine-LibDanceTag,代码行数:4,代码来源:servicebase.py

示例6: on_downloaddirButton_clicked

# 需要导入模块: from PythonQt.QtGui import QDesktopServices [as 别名]
# 或者: from PythonQt.QtGui.QDesktopServices import openUrl [as 别名]
 def on_downloaddirButton_clicked(self):
     QDesktopServices.openUrl(QUrl(self.downloaddir))
开发者ID:pathmann,项目名称:pyTSon,代码行数:4,代码来源:filetransfer.py


注:本文中的PythonQt.QtGui.QDesktopServices.openUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。