【发布时间】:2014-06-26 09:51:48
【问题描述】:
我有一个带有 PySide 的 python 代码,它有一个显示谷歌地图的 QWebView。 我只想在每次使用 QWebView 小部件执行任何请求时获得响应。
我搜索了信息,但没有关于使用 PySide 获得响应的参考。如果您需要我粘贴一些代码,我会粘贴,但我只有一个简单的 QWebView 小部件。
编辑:你问我要代码:
from PySide.QtCore import *
from PySide.QtGui import *
import sys
import pyside3
class MainDialog(QMainWindow, pyside3.Ui_MainWindow):
def __init__(self, parent=None):
super(MainDialog,self).__init__(parent)
self.setupUi(self)
token_fb=""
#self.Connect_buttom.clicked.connect(self.get_fb_token)
self.Connect_buttom.clicked.connect(lambda: self.get_fb_token(self.FB_username.text(), self.FB_password.text()))
#self.connect(self.Connect_buttom, SIGNAL("clicked()"), self.get_fb_token)
#Change between locate and hunt
self.MapsButton.clicked.connect(lambda: self.select_page_index(0))
self.HuntButton.clicked.connect(lambda: self.select_page_index(1))
###########################
self.webView.setHtml(URL)
def select_page_index(self, index): # To change between frames
self.Container.setCurrentIndex(index)
我需要来自self.webView.setHtml(URL) 的回复,因为根据回复,我的应用必须做一件事或另一件事。
【问题讨论】:
-
如果您的代码有问题,也许我们可以帮助您。
-
只有
webView.setHtml()方法Sets the content of the web view to the specified html.。我不明白您所说的“来自:self.webView.setHtml(URL)”的响应是什么意思,您希望得到什么样的响应?