Python PySide.QtCore.QUrl() Examples

The following are 10 code examples of PySide.QtCore.QUrl(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtCore , or try the search function .
Example #1
Source File: __init__.py    From python-qgmap with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #2
Source File: app.py    From shortcircuit with MIT License 6 votes vote down vote up
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 
Example #3
Source File: utils.py    From Satori with Artistic License 2.0 6 votes vote down vote up
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) 
Example #4
Source File: app.py    From bitmask-dev with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #5
Source File: __init__.py    From python-qgmap with GNU General Public License v3.0 5 votes vote down vote up
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)) 
Example #6
Source File: app.py    From shortcircuit with MIT License 5 votes vote down vote up
def logo_double_click(event):
        event.accept()
        QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://www.eve-scout.com/")) 
Example #7
Source File: app.py    From shortcircuit with MIT License 5 votes vote down vote up
def icon_double_click(event):
        event.accept()
        QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://github.com/farshield/shortcircuit")) 
Example #8
Source File: app.py    From shortcircuit with MIT License 5 votes vote down vote up
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() 
Example #9
Source File: AboutTab.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def browseSW(event):
        """
        Opens the SCHUTZWERK website.

        :param event: Dummy, not used.
        """

        QtGui.QDesktopServices.openUrl(
            QtCore.QUrl("https://www.schutzwerk.com",
                        QtCore.QUrl.TolerantMode)) 
Example #10
Source File: AboutTab.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def browseGitHub(event):
        """
        Opens the SCHUTZWERK website.

        :param event: Dummy, not used.
        """

        QtGui.QDesktopServices.openUrl(
            QtCore.QUrl(Settings.GITHUB_URL, QtCore.QUrl.TolerantMode))