當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。