Hi, On Tue, Oct 18, 2011 at 11:13 PM, Juha Turunen <[email protected]> wrote: > On Tue, Oct 18, 2011 at 6:13 PM, Johan Paul <[email protected]> wrote: >> HTTP Auth is your traditional browser popup to log in to sites with. >> AFAIK there is no way to do this in QML right now. But I would also like >> to be proven wrong (or hear it's available in QtQuick2). > > QML's XHR implements the good old W3C API which has support for HTTP > authentication. Just pass the username and password as parameters in > the call to send(). > > import QtQuick 1.0 > > Item > { > width: 400 > height: 400 > > MouseArea { > anchors.fill: parent > onClicked: { > var doc = new XMLHttpRequest(); > doc.onreadystatechange = function() { > if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) { > console.log("Headers:"); > console.log(doc.getAllResponseHeaders()); > > } else if (doc.readyState == XMLHttpRequest.DONE) { > console.log("Response:"); > console.log(doc.responseText); > } > } > > doc.open("GET", > "http://koivi.com/php-http-auth/protect.php", true, "tester", > "testing"); > doc.send(); > } > } > }
I think the OP was asking about displaying a webpage that requires HTTP auth. AFAIK, there's no way to do that without having to create your own WebView. Since the WebView does not allow customizing the QNAM, pretty much all features related to QNAM are not available. These are times when I wish the C++ item code is public :-). Girish _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
