本文整理汇总了Python中PySide.QtCore.QUrl方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QUrl方法的具体用法?Python QtCore.QUrl怎么用?Python QtCore.QUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore
的用法示例。
在下文中一共展示了QtCore.QUrl方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: geocode
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def geocode(self, location) :
url = QtCore.QUrl("http://maps.googleapis.com/maps/api/geocode/xml")
url.addQueryItem("address", location)
url.addQueryItem("sensor", "false")
"""
url = QtCore.QUrl("http://maps.google.com/maps/geo/")
url.addQueryItem("q", location)
url.addQueryItem("output", "csv")
url.addQueryItem("sensor", "false")
"""
request = QtNetwork.QNetworkRequest(url)
reply = self.get(request)
while reply.isRunning() :
QtGui.QApplication.processEvents()
reply.deleteLater()
self.deleteLater()
return self._parseResult(reply)
示例2: version_check_done
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def version_check_done(self, version):
self.version_thread.quit()
if version and __version__ != version:
version_box = QtGui.QMessageBox(self)
version_box.setWindowTitle("New version available!")
version_box.setText(
"You have version '{}', but there's a new version available: '{}'.".format(__version__, version)
)
version_box.addButton("Download now", QtGui.QMessageBox.AcceptRole)
version_box.addButton("Remind me later", QtGui.QMessageBox.RejectRole)
ret = version_box.exec_()
if ret == QtGui.QMessageBox.AcceptRole:
QtGui.QDesktopServices.openUrl(
QtCore.QUrl("https://github.com/farshield/shortcircuit/releases/tag/{}".format(version))
)
# event: QCloseEvent
示例3: download_button_clicked
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def download_button_clicked(self):
directory = QtGui.QFileDialog().getExistingDirectory()
if not directory or len(directory) == 0 or not os.path.exists(directory):
return
self.download_button.setVisible(False)
self.download_progress.setVisible(True)
filename = os.path.basename(self.link())
self.full_filename = os.path.join(directory, filename)
url = QtCore.QUrl(self.link())
request = QtNetwork.QNetworkRequest(url)
self.current_download = self.manager.get(request)
self.current_download.setReadBufferSize(1048576)
self.connect(self.current_download, QtCore.SIGNAL("downloadProgress(qint64, qint64)"),
self.download_hook)
self.current_download.downloadProgress.connect(self.download_hook)
self.current_download.finished.connect(self.download_finished)
self.current_download.readyRead.connect(self.download_ready_read)
self.current_f = open(self.full_filename, 'wb')
self.parent.exiting.connect(self.closing)
示例4: loadPage
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def loadPage(self, web_page):
if os.path.isabs(web_page):
web_page = os.path.relpath(web_page)
url = QtCore.QUrl(web_page)
self.load(url)
示例5: __init__
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def __init__(self, parent, debug=True) :
super(QGoogleMap, self).__init__(parent)
if debug :
QtWebKit.QWebSettings.globalSettings().setAttribute(
QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
self.setPage(_LoggedPage())
self.initialized = False
self.loadFinished.connect(self.onLoadFinished)
self.page().mainFrame().addToJavaScriptWindowObject(
"qtWidget", self)
basePath=os.path.abspath(os.path.dirname(__file__))
url = 'file://'+basePath+'/qgmap.html'
self.load(QtCore.QUrl(url))
示例6: logo_double_click
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def logo_double_click(event):
event.accept()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://www.eve-scout.com/"))
示例7: icon_double_click
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def icon_double_click(event):
event.accept()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://github.com/farshield/shortcircuit"))
示例8: btn_eve_login_clicked
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def btn_eve_login_clicked(self):
if not self.eve_connected:
url = self.crestp.login()
QtGui.QDesktopServices.openUrl(QtCore.QUrl.fromEncoded(url))
else:
self.crestp.logout()
示例9: browseSW
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def browseSW(event):
"""
Opens the SCHUTZWERK website.
:param event: Dummy, not used.
"""
QtGui.QDesktopServices.openUrl(
QtCore.QUrl("https://www.schutzwerk.com",
QtCore.QUrl.TolerantMode))
示例10: browseGitHub
# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import QUrl [as 别名]
def browseGitHub(event):
"""
Opens the SCHUTZWERK website.
:param event: Dummy, not used.
"""
QtGui.QDesktopServices.openUrl(
QtCore.QUrl(Settings.GITHUB_URL, QtCore.QUrl.TolerantMode))