tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
       
     1 import Qt 4.7
       
     2 
       
     3 QtObject {
       
     4     property int readyState
       
     5     property bool statusIsException: false
       
     6     property bool statusTextIsException: false
       
     7     property string responseText
       
     8     property bool responseXMLIsNull
       
     9 
       
    10     Component.onCompleted: {
       
    11         var xhr = new XMLHttpRequest();
       
    12 
       
    13         readyState = xhr.readyState;
       
    14         try {
       
    15             status = xhr.status;
       
    16         } catch (error) {
       
    17             if (error.code == DOMException.INVALID_STATE_ERR)
       
    18                 statusIsException = true;
       
    19         }
       
    20         try {
       
    21             statusText = xhr.statusText;
       
    22         } catch (error) {
       
    23             if (error.code == DOMException.INVALID_STATE_ERR)
       
    24                 statusTextIsException = true;
       
    25         }
       
    26         responseText = xhr.responseText;
       
    27         responseXMLIsNull = (xhr.responseXML == null);
       
    28     }
       
    29 }
       
    30