本文整理汇总了Python中PyQt4.QtCore.QUrl.queryItems方法的典型用法代码示例。如果您正苦于以下问题:Python QUrl.queryItems方法的具体用法?Python QUrl.queryItems怎么用?Python QUrl.queryItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QUrl
的用法示例。
在下文中一共展示了QUrl.queryItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: downloadFile
# 需要导入模块: from PyQt4.QtCore import QUrl [as 别名]
# 或者: from PyQt4.QtCore.QUrl import queryItems [as 别名]
def downloadFile(self):
url = QUrl(self.url_to_download)
fileName = QFileDialog.getSaveFileName(self, "Enregistrer la liste des dossiers", self.nameFile, "conf")
if QFile.exists(fileName):
QFile.remove(fileName)
self.outFile = QFile(fileName)
if not self.outFile.open(QIODevice.WriteOnly):
QMessageBox.information(self, 'Erreur','Impossible d\'enregistrer le fichier %s: %s.' % (fileName, self.outFile.errorString()))
self.outFile = None
return
#Création que la connexion HTTPS
mode = QHttp.ConnectionModeHttps
port = 0
self.http.setHost(url.host(), mode, port)
self.requeteHTTPannule = False
path = QUrl.toPercentEncoding(url.path(), "!$&'()*+,;=:@/")
if path:
path = str(path)
else:
path = '/'
#Concaténation des paramètres à l'URL
path = path+("?")
for item in url.queryItems():
path = path + item[0] + "=" + item[1] + "&"
self.http.setUser(self.login, self.password)
self.httpGetId = self.http.get(path, self.outFile)