qtwebengine

Running QtWebEngine with C++

偶尔善良 提交于 2019-12-05 22:37:02
问题 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(

Crossplatform webview in Qt5.6

一笑奈何 提交于 2019-12-05 20:48:29
问题 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

QT 5.4 WebEngine dev tools for javascript

不羁岁月 提交于 2019-12-05 16:44:40
I'm creating an application using QWebEngineView and QWebEnginePage. I was wondering if there is a way to active the Web Dev Tools? I need to debug the html, javascript code like you do it using Google Developer Tool on Chrome. If it is not possible in QT 5.4 does anyone know when it is planned to be included in future versions of QT ? add these line to your code #ifdef QT_DEBUG qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "9000"); #endif after launching your application start google chrome then navigate to http://localhost:9000 you will get developer tools You can do it with older QWebView, see

How to build Qt (with QtWebEngine support) using meta-toolchain-qt5?

拜拜、爱过 提交于 2019-12-05 15:26:29
I am trying to build Qt using meta-toolchain-qt5 , but when I do this via poky-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-vfp-vfpv4-neon-toolchain-2.0.1.s‌​‌​h , I don't see anything about QtWebEngine in the sysroot directory. I also tried to build Qt using the following command bitbake meta-toolchain-qt5 but it is the same result; I don't have anything regarding Qt WebEngine. How can I build Qt with QtWebEngine support? Looking at meta-toolchain-qt5 it inherits populate_sdk_qt5 , which in turns adds packagegroup-qt5-toolchain-target to the SDK. Taking a closer look at packagegroup-qt5

Project ERROR: Unknown module(s) in QT: webengine

北战南征 提交于 2019-12-05 14:31:03
I have compiled a framebuffer (without x11 and wayland) image for wandboard-quad with Yocto Jethro. I have used the Freescale Community BSP Jethro branch.The image contains most of the Qt 5.5 components and Qt Web Engine. The qmake version is 5.5.1 from meta-toolchain-qt5 and Qt Creator is 5.5 as well. I created the quick nano browser example to test the functionalities. But, Qt Creator gives me this Project ERROR: Unknown module(s) in QT: webengine when I cross compile to wandboard. Desktop compile is fine though. Anyone knows what is wrong? Edit : I have follow how to set up Qt Creator in

Render web content offscreen using QtWebEngine

白昼怎懂夜的黑 提交于 2019-12-05 14:15:05
I am trying to port an application that uses QtWebKit to render web content over to one that uses QtWebEngine. I am limited what I can change architecturally so I have to stick with the current approach of rendering the page, capturing to a memory buffer and then moving that across to a different process where the buffer is used as a texture in OpenGL. I've tried porting the code over (broadly speaking) by replacing WebKit with WebEngine, but the APIs are different. Can anyone tell me if this is possible? If so, please point me in the right direction to illustrates how to hook everything up.

QWebEngineView crashes on load() or page() method

本秂侑毒 提交于 2019-12-05 13:25:40
I'm working on porting a Qt 5.5, QWebView project to Qt 5.6 (beta), QWebEngine. I've gone through the porting guide here . My code looks like this: .h file defines _view like so: QWebEngineView* _view; and the .cpp constructor (class inherits from QWidget) has: QVBoxLayout* vbox = new QVBoxLayout(this); _view = new QWebEngineView(this); connect(_view, SIGNAL(loadFinished(bool)), this, SLOT(loadPageFinished(bool))); QString webDir = getReportBasePath() + no_tr("/index.html#") + startingPage; // QWebEnginePage *page = _view->page(); // <-- CRASH!! _view->load( QUrl("file:///" + webDir ) ); // <-

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

青春壹個敷衍的年華 提交于 2019-12-05 12:13:20
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()->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); view->settings()->setAttribute

Make mp4/h264 video work in QtWebEngine on Windows

天涯浪子 提交于 2019-12-05 06:35:42
问题 When I point the QtWebEngine instance at a html5 test page (http://www.quirksmode.org/html5/tests/video.html) I see the WebM video, the Theora video, but not H.264/MP4. Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux said to build qtwebengine from source, so I'm building everything. I downloaded this source package: http://download.qt.io/official_releases/qt/5.5/5.5.0/single/qt-everywhere-opensource-src-5.5.0.zip I followed the directions for other dependencies, and then tried

How to set QNetworkCookieJar in QWebEngine?

百般思念 提交于 2019-12-05 05:24:37
问题 In QWebView it was possible to set a QNetworkCookieJar via QNetworkAccessManager. QNetworkAccessManager *nam = new QNetworkAccessManager(); nam->setCookieJar(cookieJar); webView->page()->setNetworkAccessManager(nam); This was working like a charm. How can I set a QNetworkCookieJar in new QWebEngine class introduced in Qt5.4? 回答1: I found a solution, to share Cookies with QWebEngine and QNetworkAccesManager by using QWebEngineCookieStore. Subclass QNetworkCookieJar: class CookieWebEngine :