[Interest] Getting response from external web page

Jérôme Godbout jerome at bodycad.com
Mon May 2 23:07:49 CEST 2016


Hi,
Just an idea, after you submit, does the web page change url? maybe you
could change it if possible, that would help you know the submit is
completed via urlChanged() signal.

Not sure which version of Qt, but if you can move to qwebengineview
http://doc.qt.io/qt-5/qwebengineview.html

The web page should store the answer somewhere and make it possible to
access it.

Not sure how to achieve that with QWidgets, in Qml with WebView you can
request runJavaScript(), maybe someone can point out any equivalent for
QWidget.

Maybe if you redirect after submit, you could plain put the answer into the
web page where you could read the content of the page once url changed to
answer and page is finish loaded.

Not sure if you have control over the webserver side or web page here.

Jerome


On Mon, May 2, 2016 at 4:19 PM, Larry Martell <larry.martell at gmail.com>
wrote:

> I have a situation where I want to bring up a web page that the user
> will interact with, and when they click on a submit button a response
> is sent, and I want to get that response in my Qt program and then
> destroy the view with the page. I am able to bring up the page like
> this:
>
>   Dialog.resize(1500, 1000);
>   loginView = new QWebView(&Dialog);
>   loginView->setObjectName(QStringLiteral("webView"));
>   loginView->setUrl(QUrl(QStringLiteral("http://foo.bar.com/baz/")));
>   Dialog.exec();
>
> But I have no idea how I could get the response sent when the user
> submits the page, nor how I would destroy the page.
>
> Can anyone help me with this?
>
> Thanks!
> Larry
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160502/f1b88fea/attachment.html>


More information about the Interest mailing list