[Interest] Key_Return and Key_Enter QtWebEngine input field

Johannes Pointner h4nn35.work at gmail.com
Thu Aug 25 10:59:43 CEST 2016


Hello Viktor,



2016-08-25 10:09 GMT+02:00 Viktor Engelmann <viktor.engelmann at qt.io>:

> Hello Hannes,
>
> have you tried triggering the submit button?
>
No, I haven't tried this yet.

> But consider that a website could override the events - and it is also
> generally not considered good style to control an object by simulating user
> input (it is very fragile and could also be disrupted by actual user
> inputs).
>
> I would rather incorporate the HTTP communication directly.
> For example navigate to
> "https://www.google.com/search?q=" <https://www.google.com/search?q=> +
> QUrl::toPercentEncoding(YOUR_SEARCH_TERM)
> or if the fields are transmitted via HTTP POST, see
> https://codereview.qt-project.org/#/c/167422/
>
I use this for a simple keyboard on my touchscreen so I thought generating
a QKeyEvent would be a nice way to accomplish this.

What surprised me, was the fact that also the QtVirtualKeyboard
enter/return key couldn't trigger the input field.

> Regards
>
> Viktor
>
>
>
> Am 25.08.2016 um 08:59 schrieb Johannes Pointner:
>
> Hello all,
>
> I'm trying to use a QKeyEvent to trigger the same action as if I hit
> the enter/return key on my keyboard on an input field in a webpage
> (like starting a search in google or login to something).
> But I can't get it to work. All other keys I tried like backspace or
> characters work.
> I also tried to accomplish this with the new QtVirtualKeyboard but
> there the enter/return key also didn't work.
>
> Isn't this possible for the QtWebEngine?
>
> I'm using Qt5.7 and Arch Linux (x86_64)
>
> Thx in advance,
> Hannes
> _______________________________________________
> Interest mailing listInterest at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>
>
> --
>
>
> Viktor Engelmann
> Software Engineer
>
> The Qt Company GmbH
> Rudower Chaussee 13
> D-12489 Berlin
> Viktor.Engelmann at qt.io
> +49 151 26784521
> http://qt.io
>
> Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht
> Charlottenburg, HRB 144331 B
> <http://qt.io>
> <http://www.facebook.com/Qt> <http://www.twitter.com/qtproject>
> <https://www.linkedin.com/company/the-qt-company/>
> <https://plus.google.com/104580575722059274792>
> <https://www.youtube.com/QtStudios>
> [image: Qt World Summit 2016] <http://qtworldsummit.com/>
> Qt World Summit 2016 | Pier 27, San Francisco, CA
> Experience Exponential Potential on October 18-20
> www.qtworldsummit.com
>
> _______________________________________________
> 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/20160825/947123be/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_logo_with_text_green_rgb_400x141.png
Type: image/png
Size: 16849 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_facebook.png
Type: image/png
Size: 1407 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_youtube.png
Type: image/png
Size: 1610 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtworldsummit2016_banner.jpg
Type: image/jpeg
Size: 35183 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_linkedin.png
Type: image/png
Size: 1532 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_twitter.png
Type: image/png
Size: 1778 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_googleplus.png
Type: image/png
Size: 1957 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/947123be/attachment-0005.png>


More information about the Interest mailing list