December 27, 2011

a.martelli a.martelli
Lab Rat
1 posts

QWebView and keyboard navigation in Qt4.6 and non-touch Symbian devices

 

Hello,

this is my first post in this forum, so..hi all!
I’m developing an application for Symbian 3rd edition non-touch phones, which support at most Qt4.6.
What I need is to interact, using the phone keyboard, with a form in a web page, edit a couple of fields and press a submit button.

The best result I obtained until now is to intercept the keyPress event on the webview’s parent widget and to move between focusable elements (links, inputs, etc..) in the web page. What I do is:

  1. case Qt::Key_Up:
  2. {
  3.     bool b = webview->page()->focusNextPrevChild(false);
  4.     break;
  5. }
  6. case Qt::Key_Down:
  7. {
  8.     bool b = webview->page()->focusNextPrevChild(true);
  9.     LOG_INFO("Next page element move: " + b);
  10.     break;
  11. }

But it “works” in a terrible way! I can’t “click” on links and buttons, I can edit only one input field, after which I’m not able to edit any other field, and the backspace is not working.

Do somebody know if there is a best pratice to achieve this result or have some suggestions?

[EDIT: code formatting, please wrap in @-tags, Volker]

0 replies

 
  ‹‹ Dynamically Pushpin on Nokia Map      Problem linking with shared lib in Harmattan ››

You must log in to post a reply. Not a member yet? Register here!