qwebengineview

How can I get the maximum and current value of the verticalScrollBar when displaying html with QWebEngineView

强颜欢笑 提交于 2019-12-24 11:50:01
问题 I'm attempting to create a UI in Maya (Python 2.7.11 and Maya Qt 5.6.1. and PySide2) where the OK button is grayed out until the user scrolls to the bottom. I can do this easily with QTextEdit by grabbing the value and maximum from the verticalScrollBar but I can't seem to find similar objects in QWebEngineView or QWebEnginePage. Any Ideas? 回答1: In the case you want to get some information from the DOM you have to do it with javascript, in this case we will create an object that will have the

How to save dynamically generated web page in QWebEngineView?

别说谁变了你拦得住时间么 提交于 2019-12-23 22:27:02
问题 I am loading a web page onto QWebEngineView . A user creates a different kind of tables (reports) and then needs to save those tables to local computer as a web page. Here is what I have tried: Here I use a QWebEnginePage::save() method, but nothing happens: connect(saveButton, &QPushButton::clicked, this, [this]() { engineWebView->page()->save("save.html"); }); Then I tried a QWebEngineProfile::download() method: connect(saveButton, &QPushButton::clicked, this, [this]() { engineWebView->page

How to detect button click inside Qwebengine in pyside2

我的未来我决定 提交于 2019-12-22 08:23:12
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

How to detect button click inside Qwebengine in pyside2

試著忘記壹切 提交于 2019-12-22 08:22:43
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

Eliminate QWebChannel property notifier signal warnings

风流意气都作罢 提交于 2019-12-19 11:59:14
问题 I'm using QWebEngineView with QWebChannel , similar to this: class AppView(QWebEngineView): def __init__(self): QWebEngineView.__init__(self) self.ch = QWebChannel(self.page()) self.page().setWebChannel(self.ch) Then I call: self.ch.registerObject('app',self) and everything runs correctly. However, I then get log-spam like this: ... Property 'title'' of object 'AppView' has no notify signal and is not constant, value updates in HTML will be broken! Property 'url'' of object 'AppView' has no

Auto Grant access to Mic and Camera with Qt WebEngine

*爱你&永不变心* 提交于 2019-12-13 03:38:01
问题 I am building a home security system with RPi and WebRTC. I simply need a way to trigger a browser to open at a given URL and to auto-grant access to the Microphone and Camera. I had hoped to use the WebEngine library with PyQt but WebEngine is not supported in PyQt for RPi. So I am trying Qt itself now. Unfortunately I am not familiar with C++, so i am struggling. The example here has 90% of what I need. The code is replicated below. I just need to tweak it to grant access to the mic and

How to open download file dialog with QWebEngineView?

落花浮王杯 提交于 2019-12-11 07:24:28
问题 I'm building a pyqt5 desktop interface where I'm using QWebEngineView to show a html file where I show a Leaflet map. This is working fine. The next step is to export all features the user added to the map. When I click on "Export Features" on the map nothing happen, but when I open the same html file on my Chromium web browser, the "Export feature" opens the download dialog fine. PyQt5 script: self.MainWindow.webMapViewer = QtWebEngineWidgets.QWebEngineView() self.MainWindow.webPageLayout

Make any link (even _blank) open in same window using QWebEngine

懵懂的女人 提交于 2019-12-07 23:36:55
问题 I have this code that is supposed to visit/follow any link that I click in the same window, even if it would normally open in a new window. This would be instead of having to right-click and then select "Follow link" from context menu. For some reason, it doesn't work as expected. Here is the code: from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage class

Make any link (even _blank) open in same window using QWebEngine

徘徊边缘 提交于 2019-12-06 08:43:57
I have this code that is supposed to visit/follow any link that I click in the same window, even if it would normally open in a new window. This would be instead of having to right-click and then select "Follow link" from context menu. For some reason, it doesn't work as expected. Here is the code: from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage class WebEnginePage(QWebEnginePage): def acceptNavigationRequest(self, url, _type, isMainFrame): if _type ==

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

拟墨画扇 提交于 2019-12-02 15:52:35
问题 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