qtwebengine

How to capture the response of a request intercepted by QWebEngineUrlRequestInterceptor?

巧了我就是萌 提交于 2019-12-13 20:18:32
问题 I have a PyQt5 QWebEngineProfile with a QWebEngineUrlRequestInterceptor. This interceptor gives me access to the request before it it resolved. Is it possible to capture the response of every request intercepted without having to manually re-submit the request? class WebEngineUrlRequestInterceptor(QWebEngineUrlRequestInterceptor): def __init__(self, on_network_call): super().__init__() self.on_network_call = on_network_call def interceptRequest(self, info): self.on_network_call(info) class

Adding Qt Dependencies to spec file in rpmbuild

早过忘川 提交于 2019-12-13 10:21:28
问题 I'm using Ubuntu 14.04 and I am updating the rpmbuild spec file of an application that now uses Qt. The packages that I need are the following: sudo apt-get build-essential sudo apt-get install mesa-common-dev -y sudo apt-get install libglu1-mesa-dev -y sudo apt-get qt5-default sudo apt-get qtwebengine5-dev I know the spec file has "BuildRequires" and "Requires" dependency tags...any help in writing this as well as some examples would be helpful. I have a working spec file I just need to add

print out all the requested URLs during loading a web page

只谈情不闲聊 提交于 2019-12-13 05:38:19
问题 In my project, there is some need to get a certain requested URL in Chrome Dev Tools by Python during loading a web page, I think get the URL by Qt WebEngine is a good solution. I started by trying to use the code below to print out all the requested URLs during loading a web page, but it didn't work - no URL get printed at all , so what's wrong here ? Any good solutions ? import sys import os from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import * from PyQt5

How to wait on asynchronous javascript function without async/await support?

帅比萌擦擦* 提交于 2019-12-13 03:25:24
问题 This is something related to porting from Qt Webkit to Qt Webengine . The following code works well in webkit. <script type="text/javascript"> var result = objectExposedFromC++.someFunction(); //sync; console.log("I want to use result here"); </script> But things changed in webengine. <script type="text/javascript"> var result = objectExposedFromC++.someFunction(); //async; console.log("I want to use result here, but result isn't avaiable"); </script> One way to make it work is shown as

QtWebEngine rendering native Qt widgets in DOM?

妖精的绣舞 提交于 2019-12-13 02:26:32
问题 I am looking to rewrite a Qt application in HTML, and have QtWebEngine to render it for me. I fully understand that a HTML page will display and run in QtWebEngine. However, one thing I am really interested in, and am unable to find documentation on - apologies if I'm looking in the wrong places - is to know if QtWebEngine allows for elements of the DOM to be "swapped" for native Qt widgets. For example, could a <div id="myWidget"> actually be a QOpenGLWidget? Is this completely nonsensical?

QWebEngine & QWebChannel: transport object `qt.webChannelTransport` disappeared after page reload

家住魔仙堡 提交于 2019-12-12 19:20:52
问题 I created the web channel between my application and WebEngine in order to have exposed QObject on web side in JavaScript but the channel are lost after page reloading or in case if I click link to another page. I think I need to recreate the channel on page reload but I didn't manage to do it. I tried to do it on page load, progress and finished slots but only got js: Uncaught ReferenceError: qt is not defined . <!-- language: lang-cpp --> MainWindow::MainWindow(QWidget *parent) :

dyld: Library not loaded when using Qt QtWebEngine

微笑、不失礼 提交于 2019-12-12 04:05:43
问题 I am getting this error when trying to run my app after using macdeployqt. dyld: Library not loaded: @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick Referenced from: /x/build-x-Desktop_Qt_5_4_2_clang_64bit-Release/x.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/QtWebEngineCore Reason: image not found It only happens with a QtWebEngine app. I have another that builds just fine usingn QtWebKit. My otool results seem fine: jimmys-MacBook-Air:osx jimmy$ otool -L

How to use QtWebEngine in QML

爱⌒轻易说出口 提交于 2019-12-11 11:59:04
问题 I want to use QtWebEngine in QML with PyQT. I am trying to run simple example. import sys from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtQuick import QQuickView from PyQt5.QtQml import QQmlApplicationEngine if __name__ == '__main__': app = QApplication(sys.argv) view = QQmlApplicationEngine('main_2.qml') #view.show() app.exec_() sys.exit() import QtQuick 2.0 import QtQuick.Window 2.0 import QtWebEngine 1.0 Window { width: 1024 height: 750 visible:

Intercept AJAX POST request and read data using QWebEngine?

青春壹個敷衍的年華 提交于 2019-12-11 00:44:33
问题 I'd like to intercept POST requests made by JavaScript, read the POST data, and send a reply. Formerly with QWebKit, I used QNetworkAccessManager to do this. With Qt 5.6, I had been hoping to use QWebEngineUrlRequestInterceptor to do the same. However, I don't see any way to read the POST data. It gives me other information about there request just fine (such as the URL). Any idea how I can get the POST data? 来源: https://stackoverflow.com/questions/35448058/intercept-ajax-post-request-and

QtWebEngine Quicknano has no Sound in Embedded Linux

回眸只為那壹抹淺笑 提交于 2019-12-10 20:54:11
问题 I have compiled QtWebEngine into my i.MX6 embedded device. When I tried to play youtube Video with quicknanobrowser, the video plays but there would be no sound. In fact, there is no sound when I try to test play the audio files in hpr.dogphilosophy.net/test even though the website said that the browser codec is supported. I have enabled pulseaudio, gstreamer, ffmpeg, opus, vpx, libwebp and yet still no sound. However, I could play video with gst-launch and there would be sound. Is it