qtwebengine

How can I inject JavaScript file into a WebEngineView page?

孤人 提交于 2019-12-10 18:16:20
问题 I'm adding a script tag to a web page once it's fully loaded in a WebEngineView , but it's silently failing somehow. I inject the script by invoking webview.runJavaScript with this code: var s = document.createElement('script'); s.src = "qrc:/jquery-2.1.4.min.js"; document.body.appendChild(s); That's perfectly standard and to a certain extent it works as expected, i.e., if I view the html source of the page, the script tag has indeed been appended to the body. The problem is that the script

How to INSTALL & RUN QML QtWebEngine & QtWebKit on SBC using Yocto / Unable to fetch URL from any source

懵懂的女人 提交于 2019-12-09 15:50:01
问题 Environment Debian GNU/Linux 7.8 (wheezy) Linux marvin 3.16-0.bpo.2-amd64 #1 SMP Debian 3.16.3-2~bpo70+1 (2014-09-21) x86_64 GNU/Linux Raspberry Pi 2 Yocto Poky Qt5 My goal is to run Chromium layout web engine on the RPi2 I want to be able to run this on my RPi2: import QtQuick 2.1 import QtQuick.Controls 1.1 import QtWebEngine 1.0 ApplicationWindow { width: 1280 height: 720 visible: true WebEngineView { id: webview url: "http://www.qt-project.org" anchors.fill: parent } } How I created my

Is there any way to use QtWebEngine without OpenGL?

百般思念 提交于 2019-12-09 12:58:42
问题 I'm trying to get QtWebEngine running on a VM and am having difficulties. According to the answer to this question: Eventually I realised that OpenGL 3.3 wouldn't work easily on virtual machines .. yet. I had to boot from ubuntu usb and work from there by installing latest mesa 3d package. Is there a way to get QtWebEngine to work without OpenGL? I'm not directly using any OpenGL calls, nor do I need any 3d capabilities. I just want to embed a QWebEngineView to display dynamic HTML pages. I'm

QtWebEngine: “Not allowed to load local resource” for iframe, how to disable web security?

廉价感情. 提交于 2019-12-07 10:02:13
问题 I'm porting my application from WebKit to WebEngine (seems that one is much better for rendering angular-basad html). I faced with problem that i can't enable QtWebEngine to load local iframe, despite the fact that i've setup all possible settings that i found: Code from mainwindow.cpp view->page()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true); view->page()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true); view->page()-

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

佐手、 提交于 2019-12-06 11:36:12
问题 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? 回答1: If you are building Chromium using the official build instruction, then you just need to add the

Qt 5: Access Cookies in QtWebEngine

我们两清 提交于 2019-12-06 11:04:38
问题 Is it possible to access the QNetworkCookieJar in QtWebEngine like you could before with QtWebKit ? I can't find it anywhere in the documentation... 回答1: From Qt 5.6 onwards you can use the QWebEngineCookieStore class. 回答2: QNetworkCookie is available for QtWebEngine, but only through the old QNetworkAccessManager as QtWebEngine is using its own HTTP implementation. You can notice this while reading one of the examples: contains(DEFINES, QWEBENGINEPAGE_SETNETWORKACCESSMANAGER) { HEADERS +=

Return value from javascript to pyqt5

吃可爱长大的小学妹 提交于 2019-12-06 05:16:50
问题 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

How to get the contentSize of a web page in Qt5.4-QtWebEngine

岁酱吖の 提交于 2019-12-06 04:28:41
I'm using the new Qt5.4 with the module QtWebEngine and from what I see mainFrame() doesn't exists anymore. How to get the contentSize/size of the page and how to render it now? I tried with the setView and view but doesn't work. Check if the QWebEnginePage::geometryChangeRequested signal does what you want. Also you display a QWebEnginePage by creating a QWebEngineView (it's a QWidget ) and calling QWebEngineView::setPage(yourPage) . I couldn't find any native Qt method for that, but I came up with a workaround: once the page is loaded, I do the following to resize my widget to the web

How can I install QtWebEngine on Ubuntu

偶尔善良 提交于 2019-12-06 01:51:34
问题 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

Transparent Background in QWebEnginePage

假如想象 提交于 2019-12-06 01:01:02
问题 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