本文整理汇总了Python中PySide.QtCore.QUrl.fromPercentEncoding方法的典型用法代码示例。如果您正苦于以下问题:Python QUrl.fromPercentEncoding方法的具体用法?Python QUrl.fromPercentEncoding怎么用?Python QUrl.fromPercentEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QUrl
的用法示例。
在下文中一共展示了QUrl.fromPercentEncoding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import fromPercentEncoding [as 别名]
def __init__(self, authorize_url):
"""
Custom Webview widget to handle authentication of an authorisation url.
authorize_url is string returned via flow_from_clientsecrets.step1_get_authorize_url object
If Authorization is successful, returns an access code required for step2 of oauth flow object
"""
QWebView.__init__(self)
self.URL = QUrl.fromPercentEncoding(str(authorize_url))
self.setUrl(self.URL)
self.titleChanged.connect(self.handleTitleChange)
self.load(self.URL)
self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Popup)
示例2: play
# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import fromPercentEncoding [as 别名]
def play(self):
self._finished = 0
path = "%s/%s_%s_%s.html" % (
self._save_dir,
self._layout_id, self._region_id, self._id
)
self._widget.load("about:blank")
if 'webpage' == str(self._type) and 'native' == str(self._render):
url = self._options['uri']
self._widget.load(QUrl.fromPercentEncoding(url))
else:
self._widget.load('file://' + path)
self._widget.show()
self._widget.raise_()
self._play_timer.setInterval(int(float(self._duration) * 1000))
self._play_timer.start()
self.started_signal.emit()