Are there any functional differences between QWebView and QWebEngineView? If I understand correctly, QWebView is webkit, while QWebEngineView is blink. Are there any differences to the programmer? Does one offer more customization of look & feel over the other?
I would give QtWebEngine a try. It is replacing QtWebKit for a reason.
If you control the HTML that is getting rendered, then it probably doesn't hurt to use QWebKit. Just make sure you test your pages beforehand.
QWebView uses WebKit as the backend.
http://doc.qt.io/qt-5/qwebview.html#details
QWebEngineView uses Chromium as the backend.
http://doc.qt.io/qt-5/qwebengineview.html#details
WebKit is what is used in Konqueror on Linux and Rekonq. Its not bad, but its not as robust across general (and often imperfect) web pages/html in my opinion.
Chromium is a much newer, faster and more robust engine.
I don't know all the technical details specifically, but QWebEngine is a big step in the right direction. I've found this mostly from my own experimenting and empirical usage.
To give WebKit a decent try, look at this project and try a variety of pages:
http://qtweb.net/
https://github.com/magist3r/QtWeb
Here is some more info about QtWebEngine v QtWebKit
http://wiki.qt.io/QtWebEngine
http://en.wikipedia.org/wiki/WebKit
http://wiki.qt.io/QtWebKit
As for me I can't see some very important features in QWebEngineView. First of all you can't access to all frames on page, and you can't run JS in all frames. The next one is that you cant use QNetworkAccessManager for control view underline layer. So for now I can't see any solutions for some issues, like this How to disable sound on flashplayer in my custom application? . I want to believe that it is possible to solve it in some way, becouse QWebEngineView works much faster and seems like it have no (or less) memory leak issues then QWebView.
Framework: WebKit vs WebEngine
There used to be Qt WebKit since 2007 up to version 3. According to this Qt blog and here It is replaced by new Chromium-based web engine which is Qt WebEngine. According to the link Qt WebKit works fine right now, and will continue to do so in the years to come but if you want to have all the latest and greatest HTML5 features available for your application or device, you should consider moving over to Qt WebEngine.
As this blog says: Qt 5.4 also still contains the older Qt WebKit module. Qt WebKit is still supported, but as of Qt 5.4 we consider it done, so no new functionality will be added to it. We are also planning to deprecate Qt WebKit in future releases, as the new Qt WebEngine provides what is needed. In
My Decision: I prefer to go with the latest QtWebEngine specially when I am in the initial stage. If I hit the wall then maybe I revert to the Qt WebKit.
QML: WebView vs WebEngineView.
For having a browser item in QML there are two items WebView and WebEngineView.
WebView with the same name has been defined in both WebKit and WebEngine. Documentation for WebView in WebKit is here. It should have the import QtWebKit 3.0.
For using the WebView bound to WebEngine which is mentioned in this documentation, we need to have this import: import QtWebView 1.0. But we will highly likely face an error #5 and #6 which the solutions to debug is states in the link.
I will use the latter WebView i.e the one which is provided by WebEngine. The proof that it is related to WebEngnie is the debug solution to error #5 and #6. From now on, WebView refers to the one offered by WebEngine in this document.
As this blog says: In Qt 5.4, Qt WebView is provided which offers a more limited API to embed the web browser that is native to the underlying operating system for use cases where the full Qt WebEngine isn’t needed, or where it can’t be used because of restrictions coming from the underlying OS. In Qt 5.4, the Qt WebView module supports iOS and Android. It supports embedding the native web engines of the underlying operating system into Qt, and is currently available for Android and iOS. Because of this, Qt WebView also gives a convenient light-weight solution for simple web document integration.
WebEngineView allows QML applications to render regions of dynamic web content. A WebEngineView component may share the screen with other QML components or encompass the full screen as specified within the QML application.It is my choice in applications which are not going to be executed in iOS and Android.
Note: It is According to this blog QtWebView will fall back to using QtWebEngine when possible. In the meantime that they are making more platforms possible with WebView. It is also mentioned as a reply to a QT-Bug that: While we don't have native WebView implementations for the OS X, Window etc. we can fallback to use QtWebEngine
My Decision: WebEngineView in non Android and iOS applications.
Related
Documentation suggests that the latest QtWebEngineView should support WebRTC and HTML5 audio (I also want WebAudio API).
I'm using QtQuick 2 and QT 5.7, and the QML WebEngineView (1.1) and WebView don't support getUserMedia nor HTML5 audio.
Is it possible to have access to WebRTC and Web Audio API using QML?
Or do I have to use C++ and calling the widgets directly? (everything is supported with the webenginewidgets/demobrowser example)
I never found a good solution to this, but recent versions of Qt don't have this issue. I ended up not going the Qt route.
I'm confused with QML, QtQuick 1.0 and QtQuick 2.0. What's the difference between them?
I use QtCreator 2.8.1 based on Qt 5.1.1. I want to develop a desktop program, which technology should I use?
QML is the name of the language (just like C++, which is another language...)
QtQuick is a toolkit for QML, allowing to develop graphical interface in QML language (there are other toolkits for QML, some are graphical like Sailfish Silica or BlackBerry Cascade, and some are non-graphical like QBS which is a replacement for QMake/CMake/make...)
QtQuick 1.x was Qt4.x-based and used the QPainter/QGraphicsView API to draw the scene.
QtQuick 2.X was introduced with Qt5.0, based on Scene Graph, an OpenGLES2 abstraction layer, highly optimized.
With Qt5.1, Scene Graph was enhanced to use multithreading (QtQuick 2.1)
With Qt5.2, Scene Graph is yet a lot more optimized to reduce CPU/GPU calls and memory usage
QML engine was based on JsCore (JS engine of Webkit) in Qt4.x and was rebased on V8 (JS engine of Google Chrome) with 5.0 but this disallows to use it on mobiles and especially on iOS, so Qt5.2 introduced a new QML engine, named V4VM, created by/for Qt guys.
There are also the QtQuick Controls, which is basically a set of native-looking widgets, based on QtQuick. It was originally meant for desktop, but Qt 5.4 introduced a native L&F for Android, based on the holo theme. A material theme, as well as an iOS theme, are in development but not available as of current Qt release (5.5). Some controls were Enterprise only, but in Qt5.5 they got renamed as Extras, and they are now available for all licenses. Another development is undergoing, named QtQuickControls 2, which is a full rewrite of Controls, to gain better performance, aimed for light embedded UIs, it should at Tech Preview stage in Qt 5.6.
From Qt5.5, there is a new module named QtQuick3D, which gives ability to create 3D apps/games using QML language. It doesn't use SceneGraph which is too 2D/2.4D oriented. A new engine is named FrameGraph for this use.
If you develop modern apps you should use Qt5.x + QML 2.x + QtQuick 2.x, to touch the most vast userbase possible.
With Qt, in general, always follow the updates because they add more features, more perfomances and more platforms.
EDIT: Please refer to #TheBootroo for a better answer
Although my answer was accepted by the OP, I want to revise (or even) remove my answer.
My answer was based on personal experiences with respect to Qt 5.2 in 2013 some of which is no longer valid today:
QML is Qt Meta Language or Qt Modelling Language is a user interface markup language.
QtQuick (both QtQuick 1.x and QtQuick 2.x) uses QML as a declarative language for designing user interface–centric applications.
Back at Qt 5.2 when you built a Qt Quick Application a significant question was whether the app was QtQuick 1.x or a QtQuick 2.x. Not only did this affect the components that were available, but, it altered how the application was rendered.
Back in 2013:
QtQuick 1.x applications was often chosen if you had to target older operating systems (e.g. Windows XP) or older hardware (e.g. OLPC) because the QML UI components such as Buttons were rendered by components native to your OS. However, this meant you were targeting a lowest common denominator set of UI components and that your UI experience may vary from platform to platform.
QtQuick 2.x application was chosen for a more consistent cross platform look, but, it required that your platform implemented OpenGLES sufficiently else, your application may fail to load. This, unfortunately, restricted your application to only the newest computer and devices that implemented OpenGLES.
When I wrote my original answer, this lead me to recommend QtQuick 1.x in some scenarios over QtQuick 2.x.
However, since then, Qt 5+ now allows you to target ANGLE on Windows which brings high performance OpenGL compatibility to Windows desktops by translating calls to Direct3D, which has much better driver support.
I am currently looking at using PySide for mobile app development. I've done a few tutorials for creating desktop applications using Pyside and loving it. I understand PySide/PyQt is a port or mapping for Qt, and is usualy behind a little bit with Qt as developers of PySide/PyQt have to keep up with whatever happens in Qt.
I particularly want to develop for Android, BlackBerry and iOS. I also understand that Qt recently added support for Windows 8, as well as the more recent BlackBerry 10 OS.
My question: How well versed is PySide/PyQt in its current state with cross mobile application development.
Does it achieve mobile development by means of the WebKit component, allowing the use of everyday HTML, CSS and JavaScript?
Would it be a better option to consider PyQt for mobile app development, or PySide?
I think its not realistic to think you can use PySide/PyQt and Python in order to make one application suitable for all those platforms.
First of all the platform you want to develop for should support your programming language (Python) as well as the graphical framework (Qt) in order to make it work. This is mostly achieved by third party developers. If Python runs on your mobile operating system this does not say you can start developing and vice versa.
Mobile development is often done with QML (Qt Modeling Language). This allows you to make really cool and fancy interfaces on many platforms. You can connect it to your own Python code to make a real working application.
At this moment Qt is working on support for mobile devices. Most mobile operating systems like iOS and Windows Phone are not supported yet for the combination Python/Qt and mostly the support for working projects is not really big in comparison to the preferred languages of the operating systems.
Here is a list of mobile OS's which support the combination Python/Qt
Link to projects if there is a good link for a starting points is available
Android: PySide for Android
or if you like to use "webviews" instead of PySide: SL4A
Blackberry 10: BB-py
Meego: Python/Harmattan Project
SailFish OS: Harmattan apps (Meego) run without any problem
For your other questions I have a shorter answer.
The webkit component is intended as a content viewer component. Its not a component for building full HTML 5 apps.
The question which bindings for Qt are better is often asked. What you need to be aware of is that the old version of PyQt did almost the same as PySide. The difference was mainly in the license! However PyQt supports now Qt 5 while PySide doesn't, so make your own choice. I think you can make beautiful apps with both of them.
What is the difference between Qt for Symbian and Qt for MeeGo? I know Qt is a cross-compiling platform. Does this mean that if I use a library from Qt the exact same library works on all devices which support Qt (e.g. Symbian, MeeGo)?
For example:
QtDesktopServices can launch a web browser. Despite the name 'Desktop' is confusing for mobile devices can I launch a web browser on every device which supports Qt? If I look at MeeGo, MeeGo is used for different kind of devices e.g. In-Vehicle, TV, media phone
Is it guaranteed that every device has a web browser on it? I don't think so and that's why I'm asking. If a browser is guaranteed, which browser is it? Which features does it have? I know there is WRT, but a user here stated that WRT has discontinued. So what now?
Do I have to choose between Qt 4.7 and Qt Mobility 1.0?
What leinir said - Qt Mobility is a module that implements common features for mobile devices. Qt's API is the same on all platforms, though there are some platform-specific functions (mainly dealing with low-level stuff).
While the API (the interface) is the same, the implementation of course may be different. I suggest looking at the Qt online documentation - the pages linked under "Platform-specific Development"
According to "Platform notes - Symbian", the Symbian port is not complete and lacks some features (e.g. OpenGL support is "planned for a future release", while printing probably never will be supported). I'm pretty sure that the MeeGo/Maemo version supports OpenGL ES, as I've seen a Qt-based application using it (Stellarium on a Nokia N900).
QtMobility is an extra module for Qt, which provides a bunch of extra functionality which is more esoteric than the other 13 or so Qt modules, but functionality which is really useful when you are building applications the way you suggest.
So no, you don't choose between Qt 4.7 and QtMobility 1.0, because you have to use Qt to be able to use the extra module QtMobility :)
The browser will always be whatever is set up as the default browser on the system. So, no, there is no guarantees - for Windows, for example, you might have people using Firefox, Chrome, Internet Explorer 6 and many others. This is the nature of platform integration, i'm afraid :)
I came accross a website and what is this QTWebKit? and why do we use it and in which envoirment c++/Java or...
https://trac.webkit.org/wiki/QtWebKit#TechnicalArticles
Citing from your own link:
WebKit is an open source web browser engine. [...] QtWebKit is a project aiming at porting this fabulous engine back to Qt.
The Qt port of WebKit currently compiles and runs on Linux (including Maemo and Meego), Windows, Mac OS X and Symbian."
So it's webkit ported to Qt. What Qt is, is described e.g. here.
A simple search also reveals the Qt Webkit documentation.
Citing the site you mentioned:
WebKit is an open source web browser
engine. (...) QtWebKit is a project aiming at porting this fabulous engine back to Qt.
WebKit being an engine focused on implementing web browser's specific tasks (interpreting a web page's source (HTML, CSS), executing Java Script, creating visual representation and others) makes use of some basic services needed to accomplish these tasks. The examples of such services would be displaying an image on the screen or downloading a file over a network. These services must be provided for it to work. In case of Qt port these services are provided by Qt, which is a cross platform C++ framework for creating applications. You can find more information on Qt here.