Hello, I finally succeeded to make it working on the simulator... *unfortunately it does not work on the physical ipad.*
to make it working, I had to copy the resource files on the temp dir, to pass the temp dir to QML, then use "file://"+mytemppath+"/index.html". Also I removed all "qrc:/" in the html, and put manually the qwebchannel.js in the qrc. QString tmploc = QStandardPaths::writableLocation(QStandardPaths::TempLocation); QDir tmpdir(tmploc+"/"); qDebug() << QFileInfo(tmpdir.absolutePath()).absoluteFilePath(); QDirIterator it(":"/*, QDirIterator::Subdirectories*/); while (it.hasNext()) { QString tmpfile = it.next(); QFileInfo file = QFileInfo(tmpdir.absolutePath() + tmpfile.right(tmpfile.size()-1)); QFile::remove(file.absoluteFilePath()); // remove previous file to make sure we have the latest version QFile::copy(tmpfile, file.absoluteFilePath()); qDebug() << tmpfile; } ..... QQmlApplicationEngine engine; QQmlContext *context = engine.rootContext(); context->setContextProperty(QStringLiteral("mylocalpath"), QFileInfo(tmpdir.absolutePath()).absoluteFilePath()); ..... and in QML: WebView { id: webView anchors.fill: parent anchors.margins: 5 url: "file://"+mylocalpath+"/index.html" onLoadingChanged: { if (loadRequest.errorString) { console.error(loadRequest.errorString); } } } On Fri, Sep 14, 2018 at 9:27 PM Sylvain Pointeau <sylvain.point...@gmail.com> wrote: > I did copy the file on a writeable path, it does not load neither... does > it even load local files, located in the app document folder? > > On Fri, Sep 14, 2018 at 8:44 PM Sylvain Pointeau < > sylvain.point...@gmail.com> wrote: > >> Are you sure the WebView can load from the resources (url: >> "qrc:/index.html)? >> for me this does not work on ios, how could you make it run? >> >> Best regards, >> Sylvain >> >> On Fri, Sep 14, 2018 at 7:48 PM Sylvain Pointeau < >> sylvain.point...@gmail.com> wrote: >> >>> Hi Artem, >>> >>> I just tried yesterday and today evening. >>> For me it does work on the desktop but not on the simulator. (the screen >>> has 2 rectangles, one green with the text "some text" and one empty blue >>> box) >>> >>> I have Qt 5.11.1 >>> >>> not sure what happens... >>> >>> Best regards, >>> Sylvain >>> >>> >>> On Tue, Sep 4, 2018 at 5:09 AM Artem Sidyakin <artem.sidya...@qt.io> >>> wrote: >>> >>>> Have you succeeded? I got curious enough to try it myself and ran the >>>> example in Xcode’s Simulator - it works ( >>>> https://i.imgur.com/bhE5NJa.png). >>>> I don’t have free $99 to try it on an actual iOS device, but I guess it >>>> will work fine there too. >>>> >>>> --- >>>> Artem Sidyakin >>>> >>>> > On 29 Aug 2018, at 10:17, Artem Sidyakin <artem.sidya...@qt.io> >>>> wrote: >>>> > >>>> > Sure, I used this one: >>>> https://github.com/retifrav/qml-webchannel-websockets/tree/master/websockets-mostly-qml/websockets >>>> > And here’s an article about that just in case: >>>> https://retifrav.github.io/blog/2018/07/14/html-from-qml-over-webchannel-websockets/#mostly-qml >>>> > >>>> > --- >>>> > Artem Sidyakin >>>> > >>>> >> On 27 Aug 2018, at 00:21, Sylvain Pointeau < >>>> sylvain.point...@gmail.com> wrote: >>>> >> >>>> >> >>>> >> On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin <artem.sidya...@qt.io> >>>> wrote: >>>> >> I have an example working with Qt 5.11.1 on Mac OS and Android. >>>> >> Unfortunately, I cannot check if it works on iOS - that’s why I was >>>> guessing. >>>> >> >>>> >> could you put your example somewhere in github? so I can try it on >>>> ios? >>>> >> >>>> >> Thank you >>>> >> >>>> >> Best regards, >>>> >> Sylvain >>>> > >>>> > _______________________________________________ >>>> > Interest mailing list >>>> > Interest@qt-project.org >>>> > http://lists.qt-project.org/mailman/listinfo/interest >>>> >>>>
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest