[Interest] Key_Return and Key_Enter QtWebEngine input field

Viktor Engelmann viktor.engelmann at qt.io
Thu Aug 25 10:09:50 CEST 2016


Hello Hannes,

have you tried triggering the submit button?

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=" +
QUrl::toPercentEncoding(YOUR_SEARCH_TERM)
or if the fields are transmitted via HTTP POST, see
https://codereview.qt-project.org/#/c/167422/

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 list
> Interest at qt-project.org
> http://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>

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 <http://www.qtworldsummit.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/6c73b6fc/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/6c73b6fc/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/6c73b6fc/attachment-0001.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/6c73b6fc/attachment-0002.png>
-------------- 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/6c73b6fc/attachment-0003.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/6c73b6fc/attachment-0004.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/6c73b6fc/attachment-0005.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/6c73b6fc/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: viktor_engelmann.vcf
Type: text/x-vcard
Size: 271 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160825/6c73b6fc/attachment.vcf>


More information about the Interest mailing list