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


Python QtCore.QUrl方法代码示例

本文整理汇总了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) 
开发者ID:vokimon,项目名称:python-qgmap,代码行数:20,代码来源:__init__.py

示例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 
开发者ID:farshield,项目名称:shortcircuit,代码行数:21,代码来源:app.py

示例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) 
开发者ID:glamrock,项目名称:Satori,代码行数:23,代码来源:utils.py

示例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) 
开发者ID:leapcode,项目名称:bitmask-dev,代码行数:8,代码来源:app.py

示例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)) 
开发者ID:vokimon,项目名称:python-qgmap,代码行数:17,代码来源:__init__.py

示例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/")) 
开发者ID:farshield,项目名称:shortcircuit,代码行数:5,代码来源:app.py

示例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")) 
开发者ID:farshield,项目名称:shortcircuit,代码行数:5,代码来源:app.py

示例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() 
开发者ID:farshield,项目名称:shortcircuit,代码行数:8,代码来源:app.py

示例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)) 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:12,代码来源:AboutTab.py

示例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)) 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:11,代码来源:AboutTab.py


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