qwebengineview

PyQt5 window.close() does no close the window but window.open() works fine

瘦欲@ 提交于 2019-12-02 11:53:01
I'm using PyQt5 QWebEngineView to show a website on the window that supports basic functionalities like opening a new window. My code works fine for window.open() but for window.close() function on a webpage it removes the reference to the window but the window is physically there unless the user manually closes the window. import sys from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplication class MyWindow(QtWebEngineWidgets.QWebEngineView): currentFile = '' def __init__(self,windows, parent=None): super(MyWindow, self)._

PyQt5 retrieve form values using runJavaScript

一世执手 提交于 2019-12-02 07:45:20
问题 I have a form.html file and i run it using PyQt5 QWebEngineView . I want to retrieve form values after the Submit button is clicked. I've gone through many solutions but cannot find the perfect one. Eg: I found this one but it works on URL Change . I'm just simply looking for a solution which works on clicking the Submit button. Here's my code that i have used from the above link but i'm not getting any value returned from the form: import os import sys from PyQt5.QtWidgets import

Qt 5.8 and Pdf.js error

爱⌒轻易说出口 提交于 2019-12-02 05:44:28
I have a problem with pdf.js and Qt 5.8, i tried to do the same code in this link Using pdf.js with Qt5.8 in my application but he doesn't work i dont know why, qt show me this message about JS : "js: Uncaught TypeError: Cannot read property 'PDFJS' of undefined". this is my code in mainwindow : QWebEngineView *view; QString pdfFileURL; QString pathToPDFjs = QString("file:///"+qApp->applicationDirPath()+"/libraries/PDF/viewer.html"); pdfFileURL = "file:///C:/Users/Administrateur/Desktop/CV.pdf"; view = new QWebEngineView(); this->setCentralWidget(view); view->load(QUrl::fromUserInput

Communicate with html/javascript using QWebEngineView

让人想犯罪 __ 提交于 2019-11-30 17:55:08
问题 I need to get a dynamic content, that is being loaded by a ajax js call. I really don't know how to use PyQt but i was hoping i could do this. The HTML is something like: <a href="#" id="id" onclick="A4J.AJAX.Submit('j_id0:j_id1:j_id110',event,{'similarityGroupingId':'j_id0:j_id1:j_id110:j_id582:0:j_id584'});return false;">NETHERLANDS</a>` I can render the page with PyQt using this simple code: def render(source_html): import sys from PyQt5.QtCore import QEventLoop from PyQt5.QtWidgets import

OpenLayers Geolocation in PyQt 5.9

蓝咒 提交于 2019-11-28 14:25:20
I've implemented a Website with a geolocation function and Button. This Webpage gets displayed fine in a QwebEngineView (OSM Map too). The Webpage is loaded def __init__(self, parent=None): super(MainGUI, self).__init__(parent) self.ui = uic.loadUi("GPS.ui", self) self.ui.w3View.load(QtCore.QUrl('file:///Map.html')) All native OpenLayers Buttons (Zoom IN and OUT) are working fine. I created a new custom button to display my geolocation on the OpenLayers Map. This is the function im using to geolocate me: var handleGeolocation = function() { var coordinates; var geolocation = new ol.Geolocation

OpenLayers Geolocation in PyQt 5.9

不问归期 提交于 2019-11-27 08:34:43
问题 I've implemented a Website with a geolocation function and Button. This Webpage gets displayed fine in a QwebEngineView (OSM Map too). The Webpage is loaded def __init__(self, parent=None): super(MainGUI, self).__init__(parent) self.ui = uic.loadUi("GPS.ui", self) self.ui.w3View.load(QtCore.QUrl('file:///Map.html')) All native OpenLayers Buttons (Zoom IN and OUT) are working fine. I created a new custom button to display my geolocation on the OpenLayers Map. This is the function im using to