diff options
Diffstat (limited to 'examples/qml/xmlhttprequest')
-rw-r--r-- | examples/qml/xmlhttprequest/CMakeLists.txt | 44 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/data.xml | 5 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/doc/images/qml-xmlhttprequest-example.png | bin | 20934 -> 0 bytes | |||
-rw-r--r-- | examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc | 20 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/main.cpp | 26 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/methods.js | 34 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/xmlhttprequest.pro | 15 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/xmlhttprequest.qml | 28 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/xmlhttprequest.qmlproject | 16 | ||||
-rw-r--r-- | examples/qml/xmlhttprequest/xmlhttprequest.qrc | 7 |
10 files changed, 0 insertions, 195 deletions
diff --git a/examples/qml/xmlhttprequest/CMakeLists.txt b/examples/qml/xmlhttprequest/CMakeLists.txt deleted file mode 100644 index 63d15c37dd..0000000000 --- a/examples/qml/xmlhttprequest/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(xmlhttprequest LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/xmlhttprequest") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) - -qt_add_executable(xmlhttprequestexample - WIN32 - MACOSX_BUNDLE - main.cpp -) - -qt_add_qml_module(xmlhttprequestexample - URI xmlhttprequest - AUTO_RESOURCE_PREFIX - QML_FILES - "methods.js" - "xmlhttprequest.qml" - RESOURCES - data.xml -) - -target_link_libraries(xmlhttprequestexample PUBLIC - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick -) - -install(TARGETS xmlhttprequestexample - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/qml/xmlhttprequest/data.xml b/examples/qml/xmlhttprequest/data.xml deleted file mode 100644 index 8b7f1e116d..0000000000 --- a/examples/qml/xmlhttprequest/data.xml +++ /dev/null @@ -1,5 +0,0 @@ -<data> - <element1 /> - <element2 /> -</data> - diff --git a/examples/qml/xmlhttprequest/doc/images/qml-xmlhttprequest-example.png b/examples/qml/xmlhttprequest/doc/images/qml-xmlhttprequest-example.png Binary files differdeleted file mode 100644 index f585613427..0000000000 --- a/examples/qml/xmlhttprequest/doc/images/qml-xmlhttprequest-example.png +++ /dev/null diff --git a/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc b/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc deleted file mode 100644 index fc6ca600cd..0000000000 --- a/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only -/*! - \title Qt Quick Examples - XMLHttpRequest - \example xmlhttprequest - \brief This is a collection of XMLHttpRequest examples. - \image qml-xmlhttprequest-example.png - - \e XMLHttpRequest contains a small QML example demonstrating \l{Qt QML}'s - XMLHttpRequest functionality. For more information, visit the section about - \l{QML Global Object#XMLHttpRequest}{XMLHttpRequest}. - - \include examples-run.qdocinc - - \section1 Get Data - - \e{Get data} uses the XMLHttpRequest API to fetch an XML document from a - server. It displays the header of the HTTP response and the body of the XML - document. -*/ diff --git a/examples/qml/xmlhttprequest/main.cpp b/examples/qml/xmlhttprequest/main.cpp deleted file mode 100644 index f76ca49de5..0000000000 --- a/examples/qml/xmlhttprequest/main.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include <QDir> -#include <QGuiApplication> -#include <QQmlFileSelector> -#include <QQuickView> - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - app.setOrganizationName("QtProject"); - app.setOrganizationDomain("qt-project.org"); - app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName()); - QQuickView view; - - qputenv("QML_XHR_ALLOW_FILE_READ", QByteArray("1")); - - view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit); - view.setSource(QUrl("qrc:/qt/qml/xmlhttprequest/xmlhttprequest.qml")); - if (view.status() == QQuickView::Error) - return -1; - view.setResizeMode(QQuickView::SizeRootObjectToView); - view.show(); - return app.exec(); -} diff --git a/examples/qml/xmlhttprequest/methods.js b/examples/qml/xmlhttprequest/methods.js deleted file mode 100644 index 12bde365b2..0000000000 --- a/examples/qml/xmlhttprequest/methods.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -function showRequestInfo(text) { - msg.text = msg.text + "\n" + text -} - -function makeRequest() -{ - - var doc = new XMLHttpRequest(); - msg.text = ""; - doc.onreadystatechange = function() { - if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) { - showRequestInfo("Headers -->"); - showRequestInfo(doc.getAllResponseHeaders ()); - showRequestInfo("Last modified -->"); - showRequestInfo(doc.getResponseHeader ("Last-Modified")); - - } else if (doc.readyState == XMLHttpRequest.DONE) { - var a = doc.responseXML.documentElement; - for (var ii = 0; ii < a.childNodes.length; ++ii) { - showRequestInfo(a.childNodes[ii].nodeName); - } - showRequestInfo("Headers -->"); - showRequestInfo(doc.getAllResponseHeaders ()); - showRequestInfo("Last modified -->"); - showRequestInfo(doc.getResponseHeader ("Last-Modified")); - } - } - - doc.open("GET", "data.xml"); - doc.send(); -} diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.pro b/examples/qml/xmlhttprequest/xmlhttprequest.pro deleted file mode 100644 index 6d572fff59..0000000000 --- a/examples/qml/xmlhttprequest/xmlhttprequest.pro +++ /dev/null @@ -1,15 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp -RESOURCES += \ - xmlhttprequest.qrc - -EXAMPLE_FILES = \ - data.xml - -target.path = $$[QT_INSTALL_EXAMPLES]/qml/xmlhttprequest -INSTALLS += target - -DISTFILES += \ - methods.js diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.qml b/examples/qml/xmlhttprequest/xmlhttprequest.qml deleted file mode 100644 index 434648c16f..0000000000 --- a/examples/qml/xmlhttprequest/xmlhttprequest.qml +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls -import "methods.js" as Utils - - -Item { - height: 480 - width: 320 - - property alias msg: ttext - - Label { id: ttext; anchors.fill: parent; anchors.margins: 10 } - - Button { - id: button - anchors.horizontalCenter: parent.horizontalCenter; - anchors.bottom: parent.bottom - anchors.margins: 10 - antialiasing: true - - text: qsTr("Request data.xml") - - onClicked: Utils.makeRequest() - } -} diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.qmlproject b/examples/qml/xmlhttprequest/xmlhttprequest.qmlproject deleted file mode 100644 index 088042a100..0000000000 --- a/examples/qml/xmlhttprequest/xmlhttprequest.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - mainFile: "xmlhttprequest.qml" - /* Include .qml, .js, and image files from current directory and subdirectories */ - - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -}
\ No newline at end of file diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.qrc b/examples/qml/xmlhttprequest/xmlhttprequest.qrc deleted file mode 100644 index 39d2a62393..0000000000 --- a/examples/qml/xmlhttprequest/xmlhttprequest.qrc +++ /dev/null @@ -1,7 +0,0 @@ -<RCC> - <qresource prefix="/qt/qml/xmlhttprequest"> - <file>xmlhttprequest.qml</file> - <file>methods.js</file> - <file>data.xml</file> - </qresource> -</RCC> |