Text field bug
-
wrote on 15 Apr 2013, 12:38 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/1