[webkit-qt] Fwd: QML Virtual Keyboard + QWebview Text Inputs?
Martin Leutelt
Martin.Leutelt at basyskom.com
Mon Aug 26 01:16:34 PDT 2013
Hi,
On August 23, 2013 at 11:50 PM Mitchell Verter <mitchell.verter at gmail.com>
wrote:
>
>
>
>
>
>
>
> Hi. I have designed a Virtual Keyboard using QML and am trying to use it in
> conjunction with a Qt (not QML) Webview.
>
> I've been following the clues given in this posting
> http://qt-project.org/forums/viewthread/11237. Namely:
>
> (1) Create a custom object and then addToJavaScriptWindowObject
> [http://doc.qt.nokia.com/latest/qwebframe.html#addToJavaScriptWindowObject]
> (2) evaluateJavaScript
> [http://doc.qt.nokia.com/latest/qwebframe.html#evaluateJavaScript] to
> manifest the custom object when the input is clicked
>
> But I'm confused about how to direct the typed characters from the Virtual
> Keyboard to the TextInput/Javascript/DOM. I can emit a signal, but how would
> that be used to fill out a form? How could I keep the relationship between
> the Keyboard and the TextInput active for long enough to enter a string of
> characters?
You should be able to write a QML plugin (or provide an object to your
QDeclarativeView/QQuickView) that allows you to create QKeyEvents based on what
kind of key was pressed on your virtual keyboard and then pass them into your
WebView by using QCoreApplication::sendEvent.
>
>
>
>
>
> The link above suggests:
>
>
> QString [http://qt-project.org/doc/QString.html]
> WebBridge::openInputContext(constQString
> [http://qt-project.org/doc/QString.html] &orgtext)
>
> {
>
> QString [http://qt-project.org/doc/QString.html] text =QInputDialog
> [http://qt-project.org/doc/QInputDialog.html] ::getText(NULL,"Input
> Box","Enter your text");
>
> return(!text.isNull())? text :orgtext;
>
> }
>
> This is very nice and I have been trying to adapt it by wrapping my QML
> Keyboard in a WebBridge that inherits either from QDialog or from
> QInputContext.
>
> No luck yet. Any ideas?
>
> Thanks
> Mitchell
>
>
>
>
Regards,
Martin
--
Martin Leutelt
Software Engineer
basysKom GmbH
Robert-Bosch-Str. 7 | 64293 Darmstadt | Germany
Tel: +49 6151 870 589 -0 | Fax: -199
martin.leutelt at basyskom.com |www.basyskom.com
Handelsregister: Darmstadt HRB 9352
Geschaeftsfuehrung: Dr.-Ing. Eva Brucherseifer, Heike Ziegler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20130826/2a485607/attachment.html>
More information about the webkit-qt
mailing list