Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Dijit textbox onfocus
Forum Updated to NodeBB v4.3 + New Features

Dijit textbox onfocus

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 814 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    redoctober
    wrote on last edited by
    #1

    I try to launch my virtual keyboard at onfocus events in the html5 page. I use dijit.Form.Textbox as input method. My code is similar to other posts on this forum, e.g. "QML + Webview + virtual keyboard":http://qt-project.org/forums/viewthread/11237

    Evaluating the same javascript code in the Chrome browser works perfectly fine: clicking on the password text box results in a console message 'focus'. However, the evaluating the following Javascript code in QT example results in nothing.

    Anybody an idea?
    @
    void MyWebView::loadFinished(bool issuccessful)
    {
    if (issuccessful) {
    QWebElement document = this->page()->mainFrame()->documentElement();
    QWebElementCollection elements = document.findAll("input");
    foreach (QWebElement element, elements)
    {
    QString type = element.attribute("type");
    if (type == "password" || type == "text") {
    QString name = element.attribute("id");
    QString script = "var elems = document.getElementById("" + name + ""); elems.onfocus = function() { console.log("focus"); };";
    this->page()->mainFrame()->evaluateJavaScript(script);
    }
    }
    }
    }
    @

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved