qtwebengine

QWebEngineView modify web content before render

↘锁芯ラ 提交于 2019-12-04 19:57:00
I have three questions about QWebengineView (Qt 5.7.0): How can I modify the web content (add extra html/javascript) during load (before render) How can I get events when javascript resource included in webpage is loading ( I want to modify them, too). I get html content by page()->toHtml then set it back by setHtml , but content rendered don't like original (seems to loss format) Thanks for help! 来源: https://stackoverflow.com/questions/38162751/qwebengineview-modify-web-content-before-render

Running simple QtWebEngine app on Raspberry Pi 2, page not showing

非 Y 不嫁゛ 提交于 2019-12-04 17:01:01
I compiled and installed QtWebEngine + QML plugins on Raspberry Pi 2 with Yocto recipes using information in this tutorial using Yocto dizzy branch and run the following script: root@raspberrypi2:~# more chromium.qml import QtQuick 2.1 import QtQuick.Controls 1.1 import QtWebEngine 0.9 ApplicationWindow { width: 1280 height: 720 color: "lightgray" visible: true WebEngineView { id: webview url: "file:///home/root/hello.html" anchors.fill: parent } } Note that the IMPORT VERSION 0.9, not 1.0 I have tried both url: "file:///home/root/hello.html" and url: "https://duckduckgo.com" but all I am

Can I build chromium with ffmpeg to support all video formats?

旧巷老猫 提交于 2019-12-04 15:08:01
Under version Qt5.2, I used QtWebView, it can call third-party extensions automatically to support video formats such as avi, mpeg, mov and flv. But when I upgraded to Qt5.10 and changed QtWebView to QtWebengineView, it worked differently and I couldn't call third-party extensions. If I want to modify chromium source with ffmpeg to support all video formats for QtWebengine, what should I do? If you are building Chromium using the official build instruction , then you just need to add the following options to the args.gn file: proprietary_codecs=true ffmpeg_branding="Chrome" You needn't to use

Return value from javascript to pyqt5

牧云@^-^@ 提交于 2019-12-04 11:34:59
I'm trying to load and query a JS map widget from inside a PyQt5 application. I'm able to use the method: PyQt5.QtWebEngineWidgets.QWebEngineView().page().runJavaScript() to execute JS function from the webpage loaded in a QWebEngineView() but I'm having troubles in understanding how to store back to python a value which is returned by a JS function. A complete example is available here: The following PyQt5 code load an html page ( pyqtwebtest.html ) with a leaflet.js map widget inside a PyQt4 mainwindow and add a button to execute a JS code with the aim to store the returned value inside a

Transparent Background in QWebEnginePage

大城市里の小女人 提交于 2019-12-04 05:59:49
We are trying to port some application from Qt 4 to Qt 5.4. The Qt 5.4 has a new web engine. We used to make the background of QWebView and QWebPage to be transparent: view = new QWebView(this); QPalette palette = view->palette(); palette.setBrush(QPalette::Base, Qt::transparent); view->page()->setPalette(palette); view->setAttribute(Qt::WA_OpaquePaintEvent, false); But this code doesn't work for QWebEngineView and QWebEnginePage . The point is that QWebEnginePage doesn't have such an API like setPalette . Can anyone find a way to solve this? As mentioned in https://bugreports.qt.io/browse

How can I install QtWebEngine on Ubuntu

坚强是说给别人听的谎言 提交于 2019-12-04 05:15:55
When a QML program (e.g. Ethereum, installed from the PPA in this case) tries to import QtWebEngine 1.0 import QtWebEngine.experimental 1.0 Then I get these errors file:////usr/share/mist/qml/views/browser.qml:5 module "QtWebEngine" is not installed file:////usr/share/mist/qml/views/browser.qml:6 module "QtWebEngine.experimental" is not installed QtWebEngine is in Qt 5.4 which is what I have installed #> qmake --version QMake version 3.0 Using Qt version 5.4.0 in /usr/lib/x86_64-linux-gnu I tried to build QtWebEngine myself but no joy: #> git clone git@gitorious.org:qt-labs/qtwebengine.git

Running QtWebEngine with C++

[亡魂溺海] 提交于 2019-12-04 04:05:01
I'm trying out Qt for the first time and want to create a very basic application which loads a website. I want to use Qt WebEngine. This is my helloworld.pro: TEMPLATE = app TARGET = hello DEPENDPATH += . INCLUDEPATH += . QT += webenginewidgets SOURCES += hello.cpp And this is my hello.cpp #include <QApplication> #include <QtWebEngineWidgets/QtWebEngineWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWebEngineView *view = new QWebEngineView(parent); view->load(QUrl("http://qt-project.org/")); view->show(); return app.exec(); } When trying to compile I get the error:

Crossplatform webview in Qt5.6

拟墨画扇 提交于 2019-12-04 03:59:36
I am using Qt 5.6 with MinGW on Windows 10 64x for developing a cross platform app (desktop + mobile). In Qt 5.5, I could use WebKit to make a cross platform app for showing web pages in my app, and I could use it on Windows, Android, iOs... Today, I realized we can't use it anymore, we can't use QtWebView neither for Windows and also can't use QtWebEngine with MinGW. Thus, I am confused : knowing that I want to show a webpage using my current configuration (for android desktop and mobile version), what should I do? Is there a hope it will be solved in the next Qt versions? Edit: Even when I

Using QWebEngine to render an image

风格不统一 提交于 2019-12-04 03:20:14
I'm looking to replace QWebKit with QWebEngine in my headless renderer. I initialise the page with load() and connect a slot to loadFinished() to generate the final .PNG image. This used to work fine with WebKit but fails with QWebEngine . Code is as follows... _webView = new QWebEngineView(); .... // Render the HTML to an image QPainter painter(&image); _webView->page()->view()->render(&painter); painter.end(); I receive the following errors : "Asking for share context for widget that does not have a window handle" "QOpenGLWidget: Cannot be used without a context shared with the toplevel".

Remove ScrollBars from QWebEngineView or QWebEnginePage

≯℡__Kan透↙ 提交于 2019-12-04 03:02:18
Is there a way to remove scrollbars from QWebEngineView or can i somehow get access to it's ScrollArea? With webkit it was as easy as WebView->page()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); WebView->page()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); but i don't see any similar functionality within QWebEngine. I do not even see any scroll area within qwebengine sources.. Is there a something that i'm missing? Update: I think i can try to force scrollbars disappear from some css settings that are passed with page for chromium Just set QWebEngineSettings: