Re: [Interest] qtwebview with qtwebchannel

2018-09-18 Thread Artem Sidyakin
Glad that you have succeeded.

Meanwhile, I’ve done some tests and most importantly finally read the 
documentation (https://doc.qt.io/qt-5.11/qml-qtwebview-webview.html#url-prop), 
so loading documents to WebView through qrc:/ is actually not supported. 
However, it does work on Mac OS :) but I guess we should consider this as an 
accident happy bonus.
The rest of usecases for qrc:/ work equally fine both on Mac OS and iOS (for 
example, setting source for Image).

---
Artem Sidyakin

> On 18 Sep 2018, at 00:02, Sylvain Pointeau  wrote:
> 
> Hello Artem,
> 
> it works! your code sample pointed me on the issue.
> 
> You were using "applicationDirPath", I was using 
> QStandardPaths::writableLocation(QStandardPaths::TempLocation)
> 
> I tested applicationDirPath, same as you, it worked. (but this directory is 
> not good because not writable.)
> then I tried  QString dataloc = 
> QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
> (Warning: you must create this directory!
> QDir datadir(dataloc);
> datadir.root().mkpath(dataloc);
> )
> and it also worked!!!
> 
> Thank you very much for helping me!!!
> 
> Best regards,
> Sylvain
> 
> On Sun, Sep 16, 2018 at 5:24 PM Artem Sidyakin  wrote:
> I would understand if local file loading was allowed and remote forbidden, 
> but not the other way around. So if remote works, so should local.
> 
> To confirm that, I simply copied files into the app bundle (Show Package 
> Contents) and just to be sure checked if they are “accessible”:
> 
> foreach(QString filename, QDir(app.applicationDirPath()).entryList()) {
> qDebug() << “- " << filename;
> }
> 
> And they are, so I have the following files inside the app bundle:
> 
> websockets.app
> ├── _CodeSignature
> ├── bootstrap.min.css
> ├── default-5...@2x.png
> ├── embedded.mobileprovision
> ├── index.html
> ├── Info.plist
> ├── LaunchScreen.nib
> ├── META-INF
> ├── PkgInfo
> ├── qwebchannel.js
> └── websockets
> 
> Then I added applicationDirPath() as QML context property and loaded 
> index.html into WebView like this:
> 
> url: “file:” + applicationDirPath + “/index.html”
> 
> And it works, so it doesn’t matter where the HTML document came from, would 
> it be remote server or local file.
> 
> ---
> Artem Sidyakin
> 
> > On 16 Sep 2018, at 12:58, Sylvain Pointeau  
> > wrote:
> > 
> > 
> > 
> > Le dim. 16 sept. 2018 à 12:22, Artem Sidyakin  a 
> > écrit :
> > Original question was about “communication between WebView and QML on iOS”, 
> > which does work, as we can see.
> > Now there is an issue of loading HTML documents from file/resource system, 
> > but that’s a different kind of issue, innit (which I also would like to get 
> > to the bottom of).
> > 
> > > you confirm that the webchannel is working if the page is loaded from a 
> > > server
> > 
> > Indeed, but what difference does it make? After the page is downloaded from 
> > the server it is run locally in the WebView on device.
> > 
> > ajax for instance does not work when the file is loaded from the 
> > filesystem. I suppose there is a limitation on the websocket accessing 
> > localhost. I also suppose this can be for security reason?
> > 
> > 
> > Now, when you say
> > 
> > > unfortunately it does not work on the physical ipad
> > 
> > how exactly it does not work? Page is not loaded in the WebView? Or it is 
> > loaded (input field and button), but when you click the button nothing 
> > happens? If it’s the latter, then I would guess that qwebchannel.js is not 
> > loaded properly (wrong path, etc).
> > 
> > When I click on the button, nothing happens, and I suppose that 
> > qwebchannel.js is correctly loaded (it is in the same folder than the 
> > index.html)
> > 
> > 
> > 
> 

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-17 Thread Sylvain Pointeau
Hello Artem,

it works! your code sample pointed me on the issue.

You were using "applicationDirPath", I was using QStandardPaths::
writableLocation(QStandardPaths::TempLocation)

I tested applicationDirPath, same as you, it worked. (but this directory is
not good because not writable.)
then I tried  QString dataloc = QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation);
(Warning: you must create this directory!

QDir datadir(dataloc);

datadir.root().mkpath(dataloc);
)
and it also worked!!!

Thank you very much for helping me!!!

Best regards,
Sylvain

On Sun, Sep 16, 2018 at 5:24 PM Artem Sidyakin  wrote:

> I would understand if local file loading was allowed and remote forbidden,
> but not the other way around. So if remote works, so should local.
>
> To confirm that, I simply copied files into the app bundle (Show Package
> Contents) and just to be sure checked if they are “accessible”:
>
> foreach(QString filename, QDir(app.applicationDirPath()).entryList()) {
> qDebug() << “- " << filename;
> }
>
> And they are, so I have the following files inside the app bundle:
>
> websockets.app
> ├── _CodeSignature
> ├── bootstrap.min.css
> ├── default-5...@2x.png
> ├── embedded.mobileprovision
> ├── index.html
> ├── Info.plist
> ├── LaunchScreen.nib
> ├── META-INF
> ├── PkgInfo
> ├── qwebchannel.js
> └── websockets
>
> Then I added applicationDirPath() as QML context property and loaded
> index.html into WebView like this:
>
> url: “file:” + applicationDirPath + “/index.html”
>
> And it works, so it doesn’t matter where the HTML document came from,
> would it be remote server or local file.
>
> ---
> Artem Sidyakin
>
> > On 16 Sep 2018, at 12:58, Sylvain Pointeau 
> wrote:
> >
> >
> >
> > Le dim. 16 sept. 2018 à 12:22, Artem Sidyakin  a
> écrit :
> > Original question was about “communication between WebView and QML on
> iOS”, which does work, as we can see.
> > Now there is an issue of loading HTML documents from file/resource
> system, but that’s a different kind of issue, innit (which I also would
> like to get to the bottom of).
> >
> > > you confirm that the webchannel is working if the page is loaded from
> a server
> >
> > Indeed, but what difference does it make? After the page is downloaded
> from the server it is run locally in the WebView on device.
> >
> > ajax for instance does not work when the file is loaded from the
> filesystem. I suppose there is a limitation on the websocket accessing
> localhost. I also suppose this can be for security reason?
> >
> >
> > Now, when you say
> >
> > > unfortunately it does not work on the physical ipad
> >
> > how exactly it does not work? Page is not loaded in the WebView? Or it
> is loaded (input field and button), but when you click the button nothing
> happens? If it’s the latter, then I would guess that qwebchannel.js is not
> loaded properly (wrong path, etc).
> >
> > When I click on the button, nothing happens, and I suppose that
> qwebchannel.js is correctly loaded (it is in the same folder than the
> index.html)
> >
> >
> >
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-16 Thread Sylvain Pointeau
On Sun, Sep 16, 2018 at 5:24 PM Artem Sidyakin  wrote:

> I would understand if local file loading was allowed and remote forbidden,
> but not the other way around. So if remote works, so should local.
>

No, a local file can be a threat if you receive it by email etc.
Especially on an iOS where the downloaded code can only be HTML+ javascript
executed within a UIWebView or WKWebView.

I found that calling a webservice from google works well but localhost is
forbidden.
so for me, it proves that webchannel is impossible on iOS.

And it works, so it doesn’t matter where the HTML document came from, would
> it be remote server or local file.
>

OK it works on macos, but what about iOS?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-16 Thread Artem Sidyakin
I would understand if local file loading was allowed and remote forbidden, but 
not the other way around. So if remote works, so should local.

To confirm that, I simply copied files into the app bundle (Show Package 
Contents) and just to be sure checked if they are “accessible”:

foreach(QString filename, QDir(app.applicationDirPath()).entryList()) {
qDebug() << “- " << filename;
}

And they are, so I have the following files inside the app bundle:

websockets.app
├── _CodeSignature
├── bootstrap.min.css
├── default-5...@2x.png
├── embedded.mobileprovision
├── index.html
├── Info.plist
├── LaunchScreen.nib
├── META-INF
├── PkgInfo
├── qwebchannel.js
└── websockets

Then I added applicationDirPath() as QML context property and loaded index.html 
into WebView like this:

url: “file:” + applicationDirPath + “/index.html”

And it works, so it doesn’t matter where the HTML document came from, would it 
be remote server or local file.

---
Artem Sidyakin

> On 16 Sep 2018, at 12:58, Sylvain Pointeau  wrote:
> 
> 
> 
> Le dim. 16 sept. 2018 à 12:22, Artem Sidyakin  a écrit :
> Original question was about “communication between WebView and QML on iOS”, 
> which does work, as we can see.
> Now there is an issue of loading HTML documents from file/resource system, 
> but that’s a different kind of issue, innit (which I also would like to get 
> to the bottom of).
> 
> > you confirm that the webchannel is working if the page is loaded from a 
> > server
> 
> Indeed, but what difference does it make? After the page is downloaded from 
> the server it is run locally in the WebView on device.
> 
> ajax for instance does not work when the file is loaded from the filesystem. 
> I suppose there is a limitation on the websocket accessing localhost. I also 
> suppose this can be for security reason?
> 
> 
> Now, when you say
> 
> > unfortunately it does not work on the physical ipad
> 
> how exactly it does not work? Page is not loaded in the WebView? Or it is 
> loaded (input field and button), but when you click the button nothing 
> happens? If it’s the latter, then I would guess that qwebchannel.js is not 
> loaded properly (wrong path, etc).
> 
> When I click on the button, nothing happens, and I suppose that 
> qwebchannel.js is correctly loaded (it is in the same folder than the 
> index.html)
> 
> 
> 

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-16 Thread Sylvain Pointeau
Le dim. 16 sept. 2018 à 12:22, Artem Sidyakin  a
écrit :

> Original question was about “communication between WebView and QML on
> iOS”, which does work, as we can see.
> Now there is an issue of loading HTML documents from file/resource system,
> but that’s a different kind of issue, innit (which I also would like to get
> to the bottom of).
>
> > you confirm that the webchannel is working if the page is loaded from a
> server
>
> Indeed, but what difference does it make? After the page is downloaded
> from the server it is run locally in the WebView on device.


ajax for instance does not work when the file is loaded from the
filesystem. I suppose there is a limitation on the websocket accessing
localhost. I also suppose this can be for security reason?

>
>
> Now, when you say
>
> > unfortunately it does not work on the physical ipad
>
> how exactly it does not work? Page is not loaded in the WebView? Or it is
> loaded (input field and button), but when you click the button nothing
> happens? If it’s the latter, then I would guess that qwebchannel.js is not
> loaded properly (wrong path, etc).


When I click on the button, nothing happens, and I suppose that
qwebchannel.js is correctly loaded (it is in the same folder than the
index.html)
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-16 Thread Artem Sidyakin
Original question was about “communication between WebView and QML on iOS”, 
which does work, as we can see.
Now there is an issue of loading HTML documents from file/resource system, but 
that’s a different kind of issue, innit (which I also would like to get to the 
bottom of).

> you confirm that the webchannel is working if the page is loaded from a server

Indeed, but what difference does it make? After the page is downloaded from the 
server it is run locally in the WebView on device.

Now, when you say

> unfortunately it does not work on the physical ipad

how exactly it does not work? Page is not loaded in the WebView? Or it is 
loaded (input field and button), but when you click the button nothing happens? 
If it’s the latter, then I would guess that qwebchannel.js is not loaded 
properly (wrong path, etc).

---
Artem Sidyakin

> On 16 Sep 2018, at 11:49, Sylvain Pointeau  wrote:
> 
> 
> > Are you sure the WebView can load from the resources (url: 
> > “qrc:/index.html)?
> 
> I knew it cannot (does qrc:/ work on iOS at all?), but I was silently waiting 
> for someone to provide the way it should be done on iOS :)
> Unfortunately no-one did, so apparently it’s a bigger problem than I thought.
> And what I did - just served index.html and qwebchannel.js via regular 
> webserver (lighttpd) from my machine
> 
> OK, now I understand why I do have a different result than you.
> The use case is then different, I would not expect an app to run HTML from a 
> server but embedded into the app itself. Additionally I gave the solution how 
> to extract the HTML into the local folder and load from there.
> 
> > 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;
> > }
> > .
> > QQmlContext *context = engine.rootContext();
> > context->setContextProperty(QStringLiteral("mylocalpath"), 
> > QFileInfo(tmpdir.absolutePath()).absoluteFilePath());
> 
> > @qt developers, please could you confirm if the webchannel is working or 
> > not on ipad (with the webview)?
> 
> So I can confirm that WebChannel over WebSocket communication does work with 
> WebView on iOS.
> 
> More precisely, you confirm that the webchannel is working if the page is 
> loaded from a server.
> and I confirm that it does not work if the page is loaded from the filesystem.
> 
> It is a terrible news for me, there are so many use cases where I need to run 
> HTML pages which are downloaded or created by the app. I need to be able to 
> communicate between the HTML and the backend, to store values locally and 
> provide content.
> 
> 
> 
>  

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-16 Thread Sylvain Pointeau
> > Are you sure the WebView can load from the resources (url:
> “qrc:/index.html)?
>
> I knew it cannot (does qrc:/ work on iOS at all?), but I was silently
> waiting for someone to provide the way it should be done on iOS :)
> Unfortunately no-one did, so apparently it’s a bigger problem than I
> thought.
> And what I did - just served index.html and qwebchannel.js via regular
> webserver (lighttpd) from my machine


OK, now I understand why I do have a different result than you.
The use case is then different, I would not expect an app to run HTML from
a server but embedded into the app itself. Additionally I gave the solution
how to extract the HTML into the local folder and load from there.

> 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;
> }
> .
> QQmlContext *context = engine.rootContext();
> context->setContextProperty(QStringLiteral("mylocalpath"),
QFileInfo(tmpdir.absolutePath()).absoluteFilePath());

> @qt developers, please could you confirm if the webchannel is working or
> not on ipad (with the webview)?
>
> So I can confirm that WebChannel over WebSocket communication does work
> with WebView on iOS.
>

More precisely, you confirm that the webchannel is working if the page is
loaded from a server.
and I confirm that it does not work if the page is loaded from the
filesystem.

It is a terrible news for me, there are so many use cases where I need to
run HTML pages which are downloaded or created by the app. I need to be
able to communicate between the HTML and the backend, to store values
locally and provide content.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-15 Thread Artem Sidyakin
> I hadn’t heard about this change and old habits die hard

I can certainly double that! Good news.

> Are you sure the WebView can load from the resources (url: “qrc:/index.html)?

I knew it cannot (does qrc:/ work on iOS at all?), but I was silently waiting 
for someone to provide the way it should be done on iOS :)
Unfortunately no-one did, so apparently it’s a bigger problem than I thought.
And what I did - just served index.html and qwebchannel.js via regular 
webserver (lighttpd) from my machine.

> @qt developers, please could you confirm if the webchannel is working or not 
> on ipad (with the webview)?

Having learned that I actually can deploy to physical devices without paying 99 
USD to Apple (thank you for the link), I tried it with my iPhone, and it works 
there: https://goo.gl/uQp8fR (alerts do not work, I guess it’s iOS restriction, 
but QML label changes its text as it should).
So I can confirm that WebChannel over WebSocket communication does work with 
WebView on iOS.

---
Artem Sidyakin

> On 15 Sep 2018, at 10:21, Sylvain Pointeau  wrote:
> 
> to make it clearer, it does work on the simulator but not on my ipad device.
> @qt developers, please could you confirm if the webchannel is working or not 
> on ipad (with the webview) ?
> 
> Le ven. 14 sept. 2018 à 22:43, Sylvain Pointeau  
> a écrit :
> 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); }
> }
> }

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-15 Thread Sylvain Pointeau
to make it clearer, it does work on the simulator but not on my ipad device.
@qt developers, please could you confirm if the webchannel is working or
not on ipad (with the webview) ?

Le ven. 14 sept. 2018 à 22:43, Sylvain Pointeau 
a écrit :

> 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); }
>
> }
>
> }
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-14 Thread Sylvain Pointeau
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 
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 
>>> 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 
 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 
 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-14 Thread Sylvain Pointeau
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 
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 
>> 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  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 
>>> 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-14 Thread Sylvain Pointeau
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 
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 
> 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  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 
>> wrote:
>> >>
>> >>
>> >> On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin 
>> 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-14 Thread Sylvain Pointeau
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  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  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 
> wrote:
> >>
> >>
> >> On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin 
> 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-11 Thread Jason H
Oh, great! Thank you! I hadn't heard about this change and old habits die hard. 
I'm just about out of provisioning profiles for an app i don't distribute.

Many thanks!

> Sent: Tuesday, September 11, 2018 at 9:18 AM
> From: "Sylvain Pointeau" 
> To: "Jason H" 
> Cc: "Artem Sidyakin" , "Qt Project" 
> 
> Subject: Re: [Interest] qtwebview with qtwebchannel
>
> https://stackoverflow.com/questions/4952820/test-ios-app-on-device-without-apple-developer-program-or-jailbreak
> 
> On June 8th, Apple announced that with Xcode 7, installation of any apps
> they develop on their devices without an Apple Developer Program
> Certificate is possible. The Apple Developer website says we only need to
> log in with an Apple ID
> 
> On Tue, 11 Sep 2018 at 09:01, Jason H  wrote:
> 
> > I really hope I'm wrong, but I say it can't be done.  They only way to
> > deploy to a device is to have xcode provision it for you, to your developer
> > account, which you paid for.
> >
> > Prove me wrong. :-)
> >
> >
> >
> > > Sent: Wednesday, September 05, 2018 at 7:54 AM
> > > From: "Sylvain Pointeau" 
> > > To: "Jason H" 
> > > Cc: "Artem Sidyakin" , "Qt Project" <
> > interest@qt-project.org>
> > > Subject: Re: [Interest] qtwebview with qtwebchannel
> > >
> > > I do nothing, XCode is doing everything
> > >
> > > Le mer. 5 sept. 2018 à 00:55, Jason H  a écrit :
> > >
> > > > Neat. How do you manage that? Everytime I deploy to a new device, it
> > makes
> > > > me register it in the developer portal.
> > > >
> > > > *Sent:* Tuesday, September 04, 2018 at 2:39 PM
> > > > *From:* "Sylvain Pointeau" 
> > > > *To:* "Jason H" 
> > > > *Cc:* "Artem Sidyakin" , "Qt Project" <
> > > > interest@qt-project.org>
> > > >
> > > > *Subject:* Re: [Interest] qtwebview with qtwebchannel
> > > > Hello, yes I am 100% sure, I deploy on my ipad and I don't have an
> > active
> > > > subscription.
> > > >
> > > > Le mar. 4 sept. 2018 à 18:44, Jason H  a écrit :
> > > >
> > > >> Are you sure? The developer account costs $99. I think that is
> > > >> irrespective of where the app goes, and you get 100 devices that you
> > can
> > > >> provision.
> > > >> Unless I'm wrong?
> > > >>
> > > >> *Sent:* Tuesday, September 04, 2018 at 12:38 AM
> > > >> *From:* "Sylvain Pointeau" 
> > > >> *To:* "Artem Sidyakin" , "Qt Project" <
> > > >> interest@qt-project.org>
> > > >> *Subject:* Re: [Interest] qtwebview with qtwebchannel
> > > >>
> > > >> Hello, No I could not try yet, but I will do it this week. Note that
> > > >> there is no need to pay the subscribtion to test it on the real
> > device, the
> > > >> subscription is only needed to put it on the app store.
> > > >>
> > > >> thank you for your help!
> > > >>
> > > >> Sylvain
> > > >>
> > > >> Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
> > > >> écrit :
> > > >>
> > > >>> 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 Sidyaki
> > > >>>
> > > >>
> > > >> ___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-11 Thread Sylvain Pointeau
https://stackoverflow.com/questions/4952820/test-ios-app-on-device-without-apple-developer-program-or-jailbreak

On June 8th, Apple announced that with Xcode 7, installation of any apps
they develop on their devices without an Apple Developer Program
Certificate is possible. The Apple Developer website says we only need to
log in with an Apple ID

On Tue, 11 Sep 2018 at 09:01, Jason H  wrote:

> I really hope I'm wrong, but I say it can't be done.  They only way to
> deploy to a device is to have xcode provision it for you, to your developer
> account, which you paid for.
>
> Prove me wrong. :-)
>
>
>
> > Sent: Wednesday, September 05, 2018 at 7:54 AM
> > From: "Sylvain Pointeau" 
> > To: "Jason H" 
> > Cc: "Artem Sidyakin" , "Qt Project" <
> interest@qt-project.org>
> > Subject: Re: [Interest] qtwebview with qtwebchannel
> >
> > I do nothing, XCode is doing everything
> >
> > Le mer. 5 sept. 2018 à 00:55, Jason H  a écrit :
> >
> > > Neat. How do you manage that? Everytime I deploy to a new device, it
> makes
> > > me register it in the developer portal.
> > >
> > > *Sent:* Tuesday, September 04, 2018 at 2:39 PM
> > > *From:* "Sylvain Pointeau" 
> > > *To:* "Jason H" 
> > > *Cc:* "Artem Sidyakin" , "Qt Project" <
> > > interest@qt-project.org>
> > >
> > > *Subject:* Re: [Interest] qtwebview with qtwebchannel
> > > Hello, yes I am 100% sure, I deploy on my ipad and I don't have an
> active
> > > subscription.
> > >
> > > Le mar. 4 sept. 2018 à 18:44, Jason H  a écrit :
> > >
> > >> Are you sure? The developer account costs $99. I think that is
> > >> irrespective of where the app goes, and you get 100 devices that you
> can
> > >> provision.
> > >> Unless I'm wrong?
> > >>
> > >> *Sent:* Tuesday, September 04, 2018 at 12:38 AM
> > >> *From:* "Sylvain Pointeau" 
> > >> *To:* "Artem Sidyakin" , "Qt Project" <
> > >> interest@qt-project.org>
> > >> *Subject:* Re: [Interest] qtwebview with qtwebchannel
> > >>
> > >> Hello, No I could not try yet, but I will do it this week. Note that
> > >> there is no need to pay the subscribtion to test it on the real
> device, the
> > >> subscription is only needed to put it on the app store.
> > >>
> > >> thank you for your help!
> > >>
> > >> Sylvain
> > >>
> > >> Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
> > >> écrit :
> > >>
> > >>> 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 Sidyaki
> > >>>
> > >>
> > >> ___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-11 Thread Jason H
I really hope I'm wrong, but I say it can't be done.  They only way to deploy 
to a device is to have xcode provision it for you, to your developer account, 
which you paid for. 

Prove me wrong. :-)



> Sent: Wednesday, September 05, 2018 at 7:54 AM
> From: "Sylvain Pointeau" 
> To: "Jason H" 
> Cc: "Artem Sidyakin" , "Qt Project" 
> 
> Subject: Re: [Interest] qtwebview with qtwebchannel
>
> I do nothing, XCode is doing everything
> 
> Le mer. 5 sept. 2018 à 00:55, Jason H  a écrit :
> 
> > Neat. How do you manage that? Everytime I deploy to a new device, it makes
> > me register it in the developer portal.
> >
> > *Sent:* Tuesday, September 04, 2018 at 2:39 PM
> > *From:* "Sylvain Pointeau" 
> > *To:* "Jason H" 
> > *Cc:* "Artem Sidyakin" , "Qt Project" <
> > interest@qt-project.org>
> >
> > *Subject:* Re: [Interest] qtwebview with qtwebchannel
> > Hello, yes I am 100% sure, I deploy on my ipad and I don't have an active
> > subscription.
> >
> > Le mar. 4 sept. 2018 à 18:44, Jason H  a écrit :
> >
> >> Are you sure? The developer account costs $99. I think that is
> >> irrespective of where the app goes, and you get 100 devices that you can
> >> provision.
> >> Unless I'm wrong?
> >>
> >> *Sent:* Tuesday, September 04, 2018 at 12:38 AM
> >> *From:* "Sylvain Pointeau" 
> >> *To:* "Artem Sidyakin" , "Qt Project" <
> >> interest@qt-project.org>
> >> *Subject:* Re: [Interest] qtwebview with qtwebchannel
> >>
> >> Hello, No I could not try yet, but I will do it this week. Note that
> >> there is no need to pay the subscribtion to test it on the real device, the
> >> subscription is only needed to put it on the app store.
> >>
> >> thank you for your help!
> >>
> >> Sylvain
> >>
> >> Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
> >> écrit :
> >>
> >>> 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 Sidyaki
> >>>
> >>
> >> ___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-04 Thread Sylvain Pointeau
I do nothing, XCode is doing everything

Le mer. 5 sept. 2018 à 00:55, Jason H  a écrit :

> Neat. How do you manage that? Everytime I deploy to a new device, it makes
> me register it in the developer portal.
>
> *Sent:* Tuesday, September 04, 2018 at 2:39 PM
> *From:* "Sylvain Pointeau" 
> *To:* "Jason H" 
> *Cc:* "Artem Sidyakin" , "Qt Project" <
> interest@qt-project.org>
>
> *Subject:* Re: [Interest] qtwebview with qtwebchannel
> Hello, yes I am 100% sure, I deploy on my ipad and I don't have an active
> subscription.
>
> Le mar. 4 sept. 2018 à 18:44, Jason H  a écrit :
>
>> Are you sure? The developer account costs $99. I think that is
>> irrespective of where the app goes, and you get 100 devices that you can
>> provision.
>> Unless I'm wrong?
>>
>> *Sent:* Tuesday, September 04, 2018 at 12:38 AM
>> *From:* "Sylvain Pointeau" 
>> *To:* "Artem Sidyakin" , "Qt Project" <
>> interest@qt-project.org>
>> *Subject:* Re: [Interest] qtwebview with qtwebchannel
>>
>> Hello, No I could not try yet, but I will do it this week. Note that
>> there is no need to pay the subscribtion to test it on the real device, the
>> subscription is only needed to put it on the app store.
>>
>> thank you for your help!
>>
>> Sylvain
>>
>> Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
>> écrit :
>>
>>> 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 Sidyaki
>>>
>>
>> ___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-04 Thread Jason H
Neat. How do you manage that? Everytime I deploy to a new device, it makes me register it in the developer portal. 
 

Sent: Tuesday, September 04, 2018 at 2:39 PM
From: "Sylvain Pointeau" 
To: "Jason H" 
Cc: "Artem Sidyakin" , "Qt Project" 
Subject: Re: [Interest] qtwebview with qtwebchannel



Hello, yes I am 100% sure, I deploy on my ipad and I don't have an active subscription.


 

Le mar. 4 sept. 2018 à 18:44, Jason H <jh...@gmx.com> a écrit :





Are you sure? The developer account costs $99. I think that is irrespective of where the app goes, and you get 100 devices that you can provision.

Unless I'm wrong?

 

Sent: Tuesday, September 04, 2018 at 12:38 AM
From: "Sylvain Pointeau" <sylvain.point...@gmail.com>
To: "Artem Sidyakin" <artem.sidya...@qt.io>, "Qt Project" <interest@qt-project.org>
Subject: Re: [Interest] qtwebview with qtwebchannel

 













Hello, No I could not try yet, but I will do it this week. Note that there is no need to pay the subscribtion to test it on the real device, the subscription is only needed to put it on the app store.


 

thank you for your help!

 

Sylvain

 

Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin <artem.sidya...@qt.io> a écrit :

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 Sidyaki
 














___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-04 Thread Sylvain Pointeau
Hello, yes I am 100% sure, I deploy on my ipad and I don't have an active
subscription.

Le mar. 4 sept. 2018 à 18:44, Jason H  a écrit :

> Are you sure? The developer account costs $99. I think that is
> irrespective of where the app goes, and you get 100 devices that you can
> provision.
> Unless I'm wrong?
>
> *Sent:* Tuesday, September 04, 2018 at 12:38 AM
> *From:* "Sylvain Pointeau" 
> *To:* "Artem Sidyakin" , "Qt Project" <
> interest@qt-project.org>
> *Subject:* Re: [Interest] qtwebview with qtwebchannel
> Hello, No I could not try yet, but I will do it this week. Note that there
> is no need to pay the subscribtion to test it on the real device, the
> subscription is only needed to put it on the app store.
>
> thank you for your help!
>
> Sylvain
>
> Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
> écrit :
>
>> 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 Sidyaki
>>
>
> ___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-04 Thread Jason H

Are you sure? The developer account costs $99. I think that is irrespective of where the app goes, and you get 100 devices that you can provision.

Unless I'm wrong?

 

Sent: Tuesday, September 04, 2018 at 12:38 AM
From: "Sylvain Pointeau" 
To: "Artem Sidyakin" , "Qt Project" 
Subject: Re: [Interest] qtwebview with qtwebchannel



Hello, No I could not try yet, but I will do it this week. Note that there is no need to pay the subscribtion to test it on the real device, the subscription is only needed to put it on the app store.


 

thank you for your help!

 

Sylvain

 

Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin <artem.sidya...@qt.io> a écrit :

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 Sidyaki
 


___ 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


Re: [Interest] qtwebview with qtwebchannel

2018-09-03 Thread Sylvain Pointeau
Hello, No I could not try yet, but I will do it this week. Note that there
is no need to pay the subscribtion to test it on the real device, the
subscription is only needed to put it on the app store.

thank you for your help!

Sylvain

Le mar. 4 sept. 2018 à 05:09, Artem Sidyakin  a
écrit :

> 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 Sidyaki
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2018-09-03 Thread Artem Sidyakin
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  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  
>> wrote:
>> 
>> 
>> On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin  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


Re: [Interest] qtwebview with qtwebchannel

2018-08-29 Thread Artem Sidyakin
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  wrote:
> 
> 
> On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin  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


Re: [Interest] qtwebview with qtwebchannel

2018-08-27 Thread Sylvain Pointeau
On Sun, 26 Aug 2018 at 19:47, Artem Sidyakin  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


Re: [Interest] qtwebview with qtwebchannel

2018-08-26 Thread Artem Sidyakin
> if anybody could tell me it is working

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.

> I am wondering if this is not a security issue to open a socket

Not an expert myself, but it is a bit more safe if you'll bind to 
localhost/127.0.0.1 and not to 0.0.0.0 :)

In general, here’re some articles on the subject:
- https://gist.github.com/subudeepak/9897212#websockets---security-overview
- 
https://security.stackexchange.com/questions/161957/do-websockets-represent-a-security-problem-to-my-local-machine

So it looks like it is indeed a potential vulnerability.

---
Artem Sidyakin

> On 26 Aug 2018, at 16:38, Sylvain Pointeau  wrote:
> 
> hello,  it is different since a webview in ios is a wrapper to UIWebView 
> (which is now deprecated in ios 12 BTW).
> 
> I tried everything but i could not make it work on ios, I may have to try it 
> again with a newer Qt version In the meantime nobody really tried and 
> could proove that it works so I am a bit puzzled on this thing.
> 
> if anybody could tell me it is working then ot would save me significant time
> 
> Additionally I am wondering if this is not a security issue to open a socket, 
> does it means others could access it?
> 
> Best regards,
> Sylvain
> 
> 
> 
> On Fri, 17 Aug 2018 at 19:11, Artem Sidyakin  wrote:
> Have you already tried WebView 
> (http://doc.qt.io/qt-5/qml-qtwebview-webview.html) with WebChannel 
> (http://doc.qt.io/qt-5/qml-qtwebchannel-webchannel.html) over WebSocket 
> (https://doc.qt.io/qt-5/qml-qtwebsockets-websocketserver.html)? You referred 
> to your previous e-mail, but I haven’t seen it, sorry.
> 
> I have a working example on desktop, but I haven’t tried it on iOS, although 
> I don’t see why it would be any different. Except if iOS doesn’t allow to 
> open a WebSocket. So if you were able to make it work on desktop but failed 
> on iOS, then I guess that’s the case.
> 
> ---
> Artem Sidyakin
> 
> > On 11 Aug 2018, at 08:32, Sylvain Pointeau  
> > wrote:
> > 
> > 
> > 
> > Le jeu. 7 avr. 2016 à 13:17, Sylvain Pointeau  
> > a écrit :
> > 
> > 
> > On Thu, Apr 7, 2016 at 11:23 AM, Milian Wolff  wrote:
> > On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
> > > Hello,
> > >
> > > Do you have any idea how to use WebSocket or WebChannel on iOS?
> > > Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
> > > desktop, don't know about Android)?
> > 
> > I'm not an iOS person but the problem you are describing has nothing to do
> > with the webchannel - you seem to fail already when constructing a websocket
> > server. Have you tried to run the examples/tests of QWebSocket on iOS? 
> > That's
> > where I'd start.
> > 
> > WebSocketServer works if the QML application creates the websocket and 
> > connects to it.
> > However it does not work if we connect from html as shown in my example 
> > copied in my previous email.
> > 
> > Best regards,
> > Sylvain
> > 
> > is there anyone that could use a webview on ios and communicate with it in 
> > Qml?
> > 
> > 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


Re: [Interest] qtwebview with qtwebchannel

2018-08-26 Thread Sylvain Pointeau
hello,  it is different since a webview in ios is a wrapper to UIWebView
(which is now deprecated in ios 12 BTW).

I tried everything but i could not make it work on ios, I may have to try
it again with a newer Qt version In the meantime nobody really tried
and could proove that it works so I am a bit puzzled on this thing.

if anybody could tell me it is working then ot would save me significant
time

Additionally I am wondering if this is not a security issue to open a
socket, does it means others could access it?

Best regards,
Sylvain



On Fri, 17 Aug 2018 at 19:11, Artem Sidyakin  wrote:

> Have you already tried WebView (
> http://doc.qt.io/qt-5/qml-qtwebview-webview.html) with WebChannel (
> http://doc.qt.io/qt-5/qml-qtwebchannel-webchannel.html) over WebSocket (
> https://doc.qt.io/qt-5/qml-qtwebsockets-websocketserver.html)? You
> referred to your previous e-mail, but I haven’t seen it, sorry.
>
> I have a working example on desktop, but I haven’t tried it on iOS,
> although I don’t see why it would be any different. Except if iOS doesn’t
> allow to open a WebSocket. So if you were able to make it work on desktop
> but failed on iOS, then I guess that’s the case.
>
> ---
> Artem Sidyakin
>
> > On 11 Aug 2018, at 08:32, Sylvain Pointeau 
> wrote:
> >
> >
> >
> > Le jeu. 7 avr. 2016 à 13:17, Sylvain Pointeau <
> sylvain.point...@gmail.com> a écrit :
> >
> >
> > On Thu, Apr 7, 2016 at 11:23 AM, Milian Wolff 
> wrote:
> > On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
> > > Hello,
> > >
> > > Do you have any idea how to use WebSocket or WebChannel on iOS?
> > > Should I conclude that we cannot do hybrid apps with Qt on iOS (works
> on
> > > desktop, don't know about Android)?
> >
> > I'm not an iOS person but the problem you are describing has nothing to
> do
> > with the webchannel - you seem to fail already when constructing a
> websocket
> > server. Have you tried to run the examples/tests of QWebSocket on iOS?
> That's
> > where I'd start.
> >
> > WebSocketServer works if the QML application creates the websocket and
> connects to it.
> > However it does not work if we connect from html as shown in my example
> copied in my previous email.
> >
> > Best regards,
> > Sylvain
> >
> > is there anyone that could use a webview on ios and communicate with it
> in Qml?
> >
> > 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


Re: [Interest] qtwebview with qtwebchannel

2018-08-17 Thread Artem Sidyakin
Have you already tried WebView 
(http://doc.qt.io/qt-5/qml-qtwebview-webview.html) with WebChannel 
(http://doc.qt.io/qt-5/qml-qtwebchannel-webchannel.html) over WebSocket 
(https://doc.qt.io/qt-5/qml-qtwebsockets-websocketserver.html)? You referred to 
your previous e-mail, but I haven’t seen it, sorry.

I have a working example on desktop, but I haven’t tried it on iOS, although I 
don’t see why it would be any different. Except if iOS doesn’t allow to open a 
WebSocket. So if you were able to make it work on desktop but failed on iOS, 
then I guess that’s the case.

---
Artem Sidyakin

> On 11 Aug 2018, at 08:32, Sylvain Pointeau  wrote:
> 
> 
> 
> Le jeu. 7 avr. 2016 à 13:17, Sylvain Pointeau  a 
> écrit :
> 
> 
> On Thu, Apr 7, 2016 at 11:23 AM, Milian Wolff  wrote:
> On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
> > Hello,
> >
> > Do you have any idea how to use WebSocket or WebChannel on iOS?
> > Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
> > desktop, don't know about Android)?
> 
> I'm not an iOS person but the problem you are describing has nothing to do
> with the webchannel - you seem to fail already when constructing a websocket
> server. Have you tried to run the examples/tests of QWebSocket on iOS? That's
> where I'd start.
> 
> WebSocketServer works if the QML application creates the websocket and 
> connects to it.
> However it does not work if we connect from html as shown in my example 
> copied in my previous email.
> 
> Best regards,
> Sylvain
> 
> is there anyone that could use a webview on ios and communicate with it in 
> Qml?
> 
> 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


Re: [Interest] qtwebview with qtwebchannel

2018-08-11 Thread Sylvain Pointeau
Le jeu. 7 avr. 2016 à 13:17, Sylvain Pointeau 
a écrit :

>
>
> On Thu, Apr 7, 2016 at 11:23 AM, Milian Wolff 
> wrote:
>
>> On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
>> > Hello,
>> >
>> > Do you have any idea how to use WebSocket or WebChannel on iOS?
>> > Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
>> > desktop, don't know about Android)?
>>
>> I'm not an iOS person but the problem you are describing has nothing to do
>> with the webchannel - you seem to fail already when constructing a
>> websocket
>> server. Have you tried to run the examples/tests of QWebSocket on iOS?
>> That's
>> where I'd start.
>>
>
> WebSocketServer works if the QML application creates the websocket and
> connects to it.
> However it does not work if we connect from html as shown in my example
> copied in my previous email.
>
> Best regards,
> Sylvain
>

is there anyone that could use a webview on ios and communicate with it in
Qml?

Best regards,
Sylvain


>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-05-18 Thread Milian Wolff
On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
> Hello,
> 
> Do you have any idea how to use WebSocket or WebChannel on iOS?
> Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
> desktop, don't know about Android)?

I'm not an iOS person but the problem you are describing has nothing to do 
with the webchannel - you seem to fail already when constructing a websocket 
server. Have you tried to run the examples/tests of QWebSocket on iOS? That's 
where I'd start.

Bye

-- 
Milian Wolff | milian.wo...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-05-18 Thread Milian Wolff
On Thursday, March 31, 2016 4:46:58 PM CEST Allan Sandfeld Jensen wrote:
> On Thursday 31 March 2016, Sylvain Pointeau wrote:
> > On Tue, Mar 29, 2016 at 10:24 AM, Sylvain Pointeau <
> > 
> > sylvain.point...@gmail.com> wrote:
> > > On Tue, Mar 29, 2016 at 8:31 AM, Kalinowski Maurice <
> > > 
> > > maurice.kalinow...@theqtcompany.com> wrote:
> > >> > QtWebView has a QtWebEngine backend, and that should be available on
> > >> 
> > >> Windows.
> > >> 
> > >> For UWP/WinRT there is a platform specific implementation loading Edge
> > >> into your application. For classic desktop applications you can use Qt
> > >> Webengine as Alan described.
> > > 
> > > Excellent! do you know if / how I can use the WebChannel (or WebSocket)
> > > with QtWebView?
> > > (I tried to use WebSocketServer but it does not work on iOS.)
> > 
> > any idea? I would like to know if I can use Qt on android/ios/windows for
> > hybrid applications...
> 
> I don't know if it is possible on iOS. I believe you have to be allowed to
> setup a websocket.

It should be possible, but I haven't tried it myself and have zero iOS 
knowledge. What you need:

Qt/C++ side:
1) initialize a Qt WebSocket server
2) wrap that server in a WebChannel transport

HTML side:
1) load your HTML in any web view
2) load qwebchannel there, you will have to copy it, or create a trivial HTML 
server in your C++ side to "deploy" it from the Qt resource system to the web 
view
3) initialize the webchannel with a websocket client using the server address 
from the Qt/C++ side

The Qt WebChannel examples contain a chat e.g. that uses your system browser 
to do the above, and it works fine with Explorer, Firefox and Chrome. So as 
long as WebSockets work on iOS WebView, and Qt WebSockets work on iOS, it 
should work.

Bye
-- 
Milian Wolff | milian.wo...@kdab.com | Software Engineer
KDAB (Deutschland) GmbH KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-04-07 Thread Sylvain Pointeau
On Thu, Apr 7, 2016 at 11:23 AM, Milian Wolff  wrote:

> On Thursday, April 7, 2016 9:38:01 AM CEST Sylvain Pointeau wrote:
> > Hello,
> >
> > Do you have any idea how to use WebSocket or WebChannel on iOS?
> > Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
> > desktop, don't know about Android)?
>
> I'm not an iOS person but the problem you are describing has nothing to do
> with the webchannel - you seem to fail already when constructing a
> websocket
> server. Have you tried to run the examples/tests of QWebSocket on iOS?
> That's
> where I'd start.
>

WebSocketServer works if the QML application creates the websocket and
connects to it.
However it does not work if we connect from html as shown in my example
copied in my previous email.

Best regards,
Sylvain
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-04-07 Thread Sylvain Pointeau
Hello,

Do you have any idea how to use WebSocket or WebChannel on iOS?
Should I conclude that we cannot do hybrid apps with Qt on iOS (works on
desktop, don't know about Android)?

Best regards,
Sylvain

On Thu, Mar 31, 2016 at 5:43 PM, Sylvain Pointeau <
sylvain.point...@gmail.com> wrote:

>
> I tried to set-up a WebSocketServer, transmit the server url to the
> WebView page url. and connect to the socket server via a web socket in
> javascript (within the WebView)
> (idea taken from
> http://blog.qt.io/blog/2011/08/31/an-oldnew-approach-to-qtwebkit-hybrid/)
>
> *on mac os x, it works fine,*
> *on iOS, it does not work*, the socket closes immediately* (note: socket
> works when opened with the url "ws://echo.websocket.org
> ")*
>
> QML code is:
>
> import Qt.labs.controls 1.0
>
> import QtQuick 2.0
>
> import QtWebSockets 1.0
>
> import QtWebView 1.1
>
>
> ApplicationWindow {
>
> visible: true
>
> title: webView.title
>
>
> function appendMessage(message) {
>
> messageBox.text += "\n" + message
>
> }
>
>
> WebSocketServer {
>
> id: server
>
> listen: true
>
> onClientConnected: {
>
> webSocket.onTextMessageReceived.connect(function(message) {
>
> appendMessage(qsTr("Server received message: 
> %1").arg(message));
>
> webSocket.sendTextMessage(qsTr("Hello Client!"));
>
> });
>
> }
>
> onErrorStringChanged: {
>
> appendMessage(qsTr("Server error: %1").arg(errorString));
>
> }
>
> }
>
>
> Text {
>
> id: messageBox
>
> text: server.url
>
> x: 0
>
> width: parent.width
>
> y: parent.y + parent.height/2
>
> height: parent.height/2
>
> }
>
>
> WebView {
>
> id: webView
>
> x: 0
>
> width: parent.width
>
> y: 0
>
> height: parent.height/2
>
> url: "file:///MYPATH/web/index.html?socketurl="+server.url
>
> }
>
> }
>
>
>
> HTML code is:
>
>
> 
>
>   
>
> Sample "Hello, World" Application
>
> 
>
>   function getUrlVars()
>
>   {
>
>   var vars = [], hash;
>
>   var hashes = 
> window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
>
>   for(var i = 0; i < hashes.length; i++)
>
>   {
>
>   hash = hashes[i].split('=');
>
>   vars.push(hash[0]);
>
>   vars[hash[0]] = hash[1];
>
>   }
>
>   return vars;
>
>   }
>
>   function displaySocketUrl() {
>
>   var params = getUrlVars();
>
>   alert(params["socketurl"]);
>
>   };
>
>
>   function WebSocketTest() {
>
>   var host = getUrlVars()["socketurl"]; 
> //document.getElementById("sockethost").value;
>
>   alert(host);
>
>
>   // Let us open a web socket
>
>   var ws = new WebSocket(host);
>
>
>   ws.onopen = function()
>
>   {
>
>   // Web Socket is connected, send data 
> using send()
>
>   ws.send("Message to send");
>
>   alert("Message is sent...");
>
>   };
>
>
>   ws.onerror = function(evt) {
>
>   alert("onerror..");
>
>   }
>
>
>   ws.onmessage = function (evt)
>
>   {
>
>   var received_msg = evt.data;
>
>   alert("Message is received: 
> "+received_msg);
>
>   };
>
>
>   ws.onclose = function(evt)
>
>   {
>
>   // websocket is closed.
>
>   alert("Connection is closed: 
> "+evt.code+" - "+evt.reason);
>
>   };
>
>   }
>
> 
>
>   
>
>   
>
> Sample "Hello, World" Application
>
> This is the home page for the HelloWorld Web application. 
>
> 
>
>  onClick="displaySocketUrl()">
>
> 
>
>   
>
> 
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-31 Thread Sylvain Pointeau
On Thu, Mar 31, 2016 at 4:53 PM, Milian Wolff  wrote:

> On Thursday, March 31, 2016 4:46:58 PM CEST Allan Sandfeld Jensen wrote:
> > On Thursday 31 March 2016, Sylvain Pointeau wrote:
> > > On Tue, Mar 29, 2016 at 10:24 AM, Sylvain Pointeau <
> > >
> > > sylvain.point...@gmail.com> wrote:
> > > > On Tue, Mar 29, 2016 at 8:31 AM, Kalinowski Maurice <
> > > >
> > > > maurice.kalinow...@theqtcompany.com> wrote:
> > > >> > QtWebView has a QtWebEngine backend, and that should be available
> on
> > > >>
> > > >> Windows.
> > > >>
> > > >> For UWP/WinRT there is a platform specific implementation loading
> Edge
> > > >> into your application. For classic desktop applications you can use
> Qt
> > > >> Webengine as Alan described.
> > > >
> > > > Excellent! do you know if / how I can use the WebChannel (or
> WebSocket)
> > > > with QtWebView?
> > > > (I tried to use WebSocketServer but it does not work on iOS.)
> > >
> > > any idea? I would like to know if I can use Qt on android/ios/windows
> for
> > > hybrid applications...
> >
> > I don't know if it is possible on iOS. I believe you have to be allowed
> to
> > setup a websocket.
>
> It should be possible, but I haven't tried it myself and have zero iOS
> knowledge. What you need:
>
> Qt/C++ side:
> 1) initialize a Qt WebSocket server
> 2) wrap that server in a WebChannel transport
>
> HTML side:
> 1) load your HTML in any web view
> 2) load qwebchannel there, you will have to copy it, or create a trivial
> HTML
> server in your C++ side to "deploy" it from the Qt resource system to the
> web
> view
> 3) initialize the webchannel with a websocket client using the server
> address
> from the Qt/C++ side
>
> The Qt WebChannel examples contain a chat e.g. that uses your system
> browser
> to do the above, and it works fine with Explorer, Firefox and Chrome. So as
> long as WebSockets work on iOS WebView, and Qt WebSockets work on iOS, it
> should work.
>

I tried the following example on iOS and it does not work:

I tried to set-up a WebSocketServer, transmit the server url to the WebView
page url. and connect to the socket server via a web socket in javascript
(within the WebView)
(idea taken from
http://blog.qt.io/blog/2011/08/31/an-oldnew-approach-to-qtwebkit-hybrid/)

*on mac os x, it works fine,*
*on iOS, it does not work*, the socket closes immediately* (note: socket
works when opened with the url "ws://echo.websocket.org
")*

QML code is:

import Qt.labs.controls 1.0

import QtQuick 2.0

import QtWebSockets 1.0

import QtWebView 1.1


ApplicationWindow {

visible: true

title: webView.title


function appendMessage(message) {

messageBox.text += "\n" + message

}


WebSocketServer {

id: server

listen: true

onClientConnected: {

webSocket.onTextMessageReceived.connect(function(message) {

appendMessage(qsTr("Server received message: %1").arg(message));

webSocket.sendTextMessage(qsTr("Hello Client!"));

});

}

onErrorStringChanged: {

appendMessage(qsTr("Server error: %1").arg(errorString));

}

}


Text {

id: messageBox

text: server.url

x: 0

width: parent.width

y: parent.y + parent.height/2

height: parent.height/2

}


WebView {

id: webView

x: 0

width: parent.width

y: 0

height: parent.height/2

url: "file:///MYPATH/web/index.html?socketurl="+server.url

}

}



HTML code is:




  

Sample "Hello, World" Application



function getUrlVars()

{

var vars = [], hash;

var hashes =
window.location.href.slice(window.location.href.indexOf('?') +
1).split('&');

for(var i = 0; i < hashes.length; i++)

{

hash = hashes[i].split('=');

vars.push(hash[0]);

vars[hash[0]] = hash[1];

}

return vars;

}

function displaySocketUrl() {

var params = getUrlVars();

alert(params["socketurl"]);

};


function WebSocketTest() {

var host = getUrlVars()["socketurl"];
//document.getElementById("sockethost").value;

alert(host);


// Let us open a web socket

var ws = new WebSocket(host);


ws.onopen = function()

{


Re: [Interest] qtwebview with qtwebchannel

2016-03-31 Thread Allan Sandfeld Jensen
On Thursday 31 March 2016, Sylvain Pointeau wrote:
> On Tue, Mar 29, 2016 at 10:24 AM, Sylvain Pointeau <
> 
> sylvain.point...@gmail.com> wrote:
> > On Tue, Mar 29, 2016 at 8:31 AM, Kalinowski Maurice <
> > 
> > maurice.kalinow...@theqtcompany.com> wrote:
> >> > QtWebView has a QtWebEngine backend, and that should be available on
> >> 
> >> Windows.
> >> 
> >> For UWP/WinRT there is a platform specific implementation loading Edge
> >> into your application. For classic desktop applications you can use Qt
> >> Webengine as Alan described.
> > 
> > Excellent! do you know if / how I can use the WebChannel (or WebSocket)
> > with QtWebView?
> > (I tried to use WebSocketServer but it does not work on iOS.)
> 
> any idea? I would like to know if I can use Qt on android/ios/windows for
> hybrid applications...
> 
I don't know if it is possible on iOS. I believe you have to be allowed to 
setup a websocket.

Regards
`Allan
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-31 Thread Sylvain Pointeau
On Tue, Mar 29, 2016 at 10:24 AM, Sylvain Pointeau <
sylvain.point...@gmail.com> wrote:

> On Tue, Mar 29, 2016 at 8:31 AM, Kalinowski Maurice <
> maurice.kalinow...@theqtcompany.com> wrote:
>
>> > QtWebView has a QtWebEngine backend, and that should be available on
>> Windows.
>>
>> For UWP/WinRT there is a platform specific implementation loading Edge
>> into your application. For classic desktop applications you can use Qt
>> Webengine as Alan described.
>
>
> Excellent! do you know if / how I can use the WebChannel (or WebSocket)
> with QtWebView?
> (I tried to use WebSocketServer but it does not work on iOS.)
>

any idea? I would like to know if I can use Qt on android/ios/windows for
hybrid applications...

Best regards,
Sylvain
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-29 Thread Sylvain Pointeau
On Tue, Mar 29, 2016 at 8:31 AM, Kalinowski Maurice <
maurice.kalinow...@theqtcompany.com> wrote:

>
> > QtWebView has a QtWebEngine backend, and that should be available on
> Windows.
>
> For UWP/WinRT there is a platform specific implementation loading Edge
> into your application. For classic desktop applications you can use Qt
> Webengine as Alan described.


Excellent! do you know if / how I can use the WebChannel (or WebSocket)
with QtWebView?
(I tried to use WebSocketServer but it does not work on iOS.)

Best regards,
Sylvain
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-29 Thread Kalinowski Maurice

> QtWebView has a QtWebEngine backend, and that should be available on Windows.

For UWP/WinRT there is a platform specific implementation loading Edge into 
your application. For classic desktop applications you can use Qt Webengine as 
Alan described.

Maurice 


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-28 Thread Sylvain Pointeau
>Le dimanche 27 mars 2016, Allan Sandfeld Jensen  a écrit
:
>
> On Sunday 27 March 2016, Sylvain Pointeau wrote:
> > please could you confirm if qtwebchannel works with qtwebview?
> > if yes, would you have some exemple to show how it works in qml?
>
> It does work, but there is no automatic integration. I would suggest
looking
> at howto for qtwebchannel from before there was automatic integration in
> QtWebKit, the principles are the same.

Hello,

I tried to set-up a WebSocketServer, transmit the server url to the WebView
page url. and connect to the socket server via a web socket in javascript
(within the WebView)
(idea taken from
http://blog.qt.io/blog/2011/08/31/an-oldnew-approach-to-qtwebkit-hybrid/)

on mac os x, it works fine,
on iOS, it does not work, the socket closes immediately.
(note: socket works when opened with the url "ws://echo.websocket.org")

Do you have any idea? Is there another trick to make the WebView
communicating with the native backend?

Best regards,
Sylvain

QML code is:

import Qt.labs.controls 1.0

import QtQuick 2.0

import QtWebSockets 1.0

import QtWebView 1.1


ApplicationWindow {

visible: true

title: webView.title


function appendMessage(message) {

messageBox.text += "\n" + message

}


WebSocketServer {

id: server

listen: true

onClientConnected: {

webSocket.onTextMessageReceived.connect(function(message) {

appendMessage(qsTr("Server received message: %1").arg(message));

webSocket.sendTextMessage(qsTr("Hello Client!"));

});

}

onErrorStringChanged: {

appendMessage(qsTr("Server error: %1").arg(errorString));

}

}


Text {

id: messageBox

text: server.url

x: 0

width: parent.width

y: parent.y + parent.height/2

height: parent.height/2

}


WebView {

id: webView

x: 0

width: parent.width

y: 0

height: parent.height/2

url: "file:///MYPATH/web/index.html?socketurl="+server.url

}

}



HTML code is:




  

Sample "Hello, World" Application



function getUrlVars()

{

var vars = [], hash;

var hashes =
window.location.href.slice(window.location.href.indexOf('?') +
1).split('&');

for(var i = 0; i < hashes.length; i++)

{

hash = hashes[i].split('=');

vars.push(hash[0]);

vars[hash[0]] = hash[1];

}

return vars;

}

function displaySocketUrl() {

var params = getUrlVars();

alert(params["socketurl"]);

};


function WebSocketTest() {

var host = getUrlVars()["socketurl"];
//document.getElementById("sockethost").value;

alert(host);


// Let us open a web socket

var ws = new WebSocket(host);


ws.onopen = function()

{

// Web Socket is connected, send data 
using send()

ws.send("Message to send");

alert("Message is sent...");

};


ws.onerror = function(evt) {

alert("onerror..");

}


ws.onmessage = function (evt)

{

var received_msg = evt.data;

alert("Message is received: 
"+received_msg);

};


ws.onclose = function(evt)

{

// websocket is closed.

alert("Connection is closed: 
"+evt.code+" - "+evt.reason);

};

}



  

  

Sample "Hello, World" Application

This is the home page for the HelloWorld Web application. 







  


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-27 Thread Sylvain Pointeau
Le dimanche 27 mars 2016, Allan Sandfeld Jensen  a écrit :

> On Sunday 27 March 2016, Sylvain Pointeau wrote:
> > please could you confirm if qtwebchannel works with qtwebview?
> > if yes, would you have some exemple to show how it works in qml?
>
> It does work, but there is no automatic integration. I would suggest
> looking
> at howto for qtwebchannel from before there was automatic integration in
> QtWebKit, the principles are the same.


does it mean I should setup a websocket local server? (do we have the right
on ios?)
do you have any link?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qtwebview with qtwebchannel

2016-03-27 Thread Allan Sandfeld Jensen
On Sunday 27 March 2016, Sylvain Pointeau wrote:
> hello,
> 
> please could you confirm if qtwebchannel works with qtwebview?
> if yes, would you have some exemple to show how it works in qml?
> 
> addtionally, does qtwebview exist for windows 10?
> 
It does work, but there is no automatic integration. I would suggest looking 
at howto for qtwebchannel from before there was automatic integration in 
QtWebKit, the principles are the same.

QtWebView has a QtWebEngine backend, and that should be available on Windows.

Best regards
`Allan
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] qtwebview with qtwebchannel

2016-03-26 Thread Sylvain Pointeau
hello,

please could you confirm if qtwebchannel works with qtwebview?
if yes, would you have some exemple to show how it works in qml?

addtionally, does qtwebview exist for windows 10?

Best regards,
Sylvain
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest