[Solved] QtWebView on ios confusion
-
from a few places i read that a non native UIWebView browsers are not allowed on ios by apple, but on
http://qt-project.org/forums/viewthread/43920
i read that QtWebView is available for ios.when i run a @import QtQuick 2.4
import QtQuick.Controls 1.3
import QtWebKit 1.0Item {
width: 300 height: 300 WebView { id: test anchors.fill: parent width: parent.width height: parent.height smooth: true url: "http://qt-project.org" }
}@
on the ios simulator and on my device i get a
@qrc:/Webview.qml:4:1: module "QtWebKit" is not installed@what should i be able to expect on Qt 5.4 for ios ?
-
Hi,
The name is a bit confusing…
Anyway, you are currently using QtWebKit and it's WebView element and not QtWebView which is what you are looking for -
i'm still confused then.
is: http://doc.qt.io/qt-5/qml-qtwebkit-webview.html
the right one that should work on ios ?if i use @import QtWebKit 3.0@ as per documentation
and leave the rest the same, i still see the problem of
@qrc:/Webview.qml:3:1: module "QtWebKit" is not installed@is there something else i would need to change or is it just my environment, and it should work ?
-
Don't use QtWebKit on iOS or Android for that matter.
See the "mini browser example":https://qt.gitorious.org/qt/qtwebview/source/examples/webview/minibrowser/ from the QtWebView repository
-
thank you ! the example made it all good :)
especially
@#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
#include <QtWebEngine>
#endif // QT_WEBVIEW_WEBENGINE_BACKEND
@
and@#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
QtWebEngine::initialize();
#endif // QT_WEBVIEW_WEBENGINE_BACKEND
@in the main, and
@qtHaveModule(webengine) {
QT += webengine
DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
}@in the .pro file