tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml
changeset 30 5dc02b23752f
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
       
     1 import Qt 4.7
       
     2 import org.webkit 1.0
       
     3 
       
     4 Column {
       
     5     WebView {
       
     6         id: webview
       
     7         width: 200
       
     8         height: 200
       
     9         url: "test-objects.html"
       
    10         javaScriptWindowObjects:
       
    11             QtObject {
       
    12                 property string text: btntext.text
       
    13                 WebView.windowObjectName: "qmltext"
       
    14                 onTextChanged: {
       
    15                     webview.evaluateJavaScript("{document.getElementById('button').value=window.qmltext.text}")
       
    16                 }
       
    17             }
       
    18     }
       
    19     Row {
       
    20         Text { text: "Input:" }
       
    21         Rectangle {
       
    22             width: btntext.width+10
       
    23             height: btntext.height+10
       
    24             border.color: "black"
       
    25             TextInput {
       
    26                 id: btntext
       
    27                 text: "Blah"
       
    28                 cursorDelegate: Rectangle { width: 1; color: "red" }
       
    29             }
       
    30         }
       
    31     }
       
    32 }