[webkit-qt] Fwd: QML Virtual Keyboard + QWebview Text Inputs?

Mitchell Verter mitchell.verter at gmail.com
Fri Aug 23 14:50:32 PDT 2013


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?


The link above suggests:

   1. QString <http://qt-project.org/doc/QString.html> WebBridge::
   openInputContext(const QString <http://qt-project.org/doc/QString.html> &
   orgtext)
   2. {
   3.     QString <http://qt-project.org/doc/QString.html> text =
   QInputDialog
<http://qt-project.org/doc/QInputDialog.html>::getText(NULL, "Input
   Box", "Enter your text");
   4.     return (!text.isNull()) ? text : orgtext;
   5. }

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20130823/490d69b2/attachment.html>


More information about the webkit-qt mailing list