Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Text field bug

    Qt WebKit
    1
    1
    601
    Loading More Posts
    • 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.
    • S
      sahara108 last edited by

      Hi,
      I have a simple web view which contains a button and a hidden text field. When double click the button, the text field will show up, allow user to edit button text. Click outside the text field to end editing.
      Here is the javascript code:
      @function doubleClick() {
      var oldValue = button.text();
      editText.css("display", block);
      editText.focus();
      editText.val(oldValue); //***
      }

      editText.delegate('#edit_text_hide').focusout(function(event) {
      var newValue = editText.val();
      button.text(newValue);
      editText.css("display", none);
      alert('finish editing');
      }@
      The code works well in browser but not for QWebview. Whenever I double click on the button, it will show alert "finish editing". I found the problem is this line @editText.val(oldValue)@. It will calls the delegate focusout and make the button can't be editable. Is it a bug of QtWebkit ???
      OS is window 7, Qt version is 5.0.2.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post