def setupUI(self): self.mainHBoxLayout = QtGui.QHBoxLayout() self.mainRVBoxLayout = QtGui.QVBoxLayout() self.mainLVBoxLayout = QtGui.QVBoxLayout() self.executeCrawler = QtGui.QPushButton("Get Content!!!") self.urlBarLineEdit = QtGui.QLineEdit( "http://www2.tpa.edu.tw/tpaedu/Home/login.asp") self.myWebView = WebView() self.myTabWidget = TabWidget() #self.myWebView.settings().setDefaultTextEncoding("big5") self.myWebView.show() self.myTabWidget.addTab(self.myWebView, "my Web View") self.mainLVBoxLayout.addWidget(self.urlBarLineEdit) self.mainLVBoxLayout.addWidget(self.myTabWidget) self.mainRVBoxLayout.addWidget(self.executeCrawler) self.mainHBoxLayout.addLayout(self.mainLVBoxLayout) self.mainHBoxLayout.addLayout(self.mainRVBoxLayout) self.setLayout(self.mainHBoxLayout) self.executeCrawler.clicked.connect(self.slotClickedToLoadUrl) self.signalClickedToLoadUrl.connect(self.slotLoadUrl) self.myWebView.loadFinished.connect(self.slotWebViewLoadFinished) self.show()
def __init__(self, TcpSocket=None): if TcpSocket == None: raise ValueError self.stop = False self.webview = WebView() self.webview.load("http://127.0.0.1") self.TcpSocket = TcpSocket
def initial(self): self.MainHLayout = QtGui.QHBoxLayout() self.WebView = WebView() self.WebView.show() self.WebView.load(QtCore.QUrl("http://127.0.0.1/tpcdebt/test.php")) self.MainHLayout.addWidget(self.WebView) self.WebView.loadFinished.connect(self.loadPageOK) self.WebView.page().setLinkDelegationPolicy( QtWebKit.QWebPage.DelegateAllLinks) self.setLayout(self.MainHLayout) self.show()