summaryrefslogtreecommitdiffstats
path: root/examples/demos
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2020-11-19 12:17:40 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2020-11-19 19:51:00 +0000
commit4e2b9e2496852bee2608268a600d3a8797997636 (patch)
treecae00f52ed3fe26cd10c160dbc60cf92825ccd1e /examples/demos
parentf07f6a3f63594f24bbf0dd9ae41f213ae689b559 (diff)
Example: Set the variable to read the XML file
Without the variable, the XmlHttpRequest cannot read the XML file. Fixes: QTBUG-87791 Change-Id: Icf699d8bbd4ec1921dadfd3331a024e04f7f5416 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/demos')
-rw-r--r--examples/demos/stocqt/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/demos/stocqt/main.cpp b/examples/demos/stocqt/main.cpp
index 84e8fb8f5..464d3ada6 100644
--- a/examples/demos/stocqt/main.cpp
+++ b/examples/demos/stocqt/main.cpp
@@ -52,13 +52,14 @@
#include <QQmlEngine>
#include <QQmlFileSelector>
#include <QQuickView>
-
+#include <QtGlobal>
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QGuiApplication app(argc, argv);
-
+ if (qEnvironmentVariableIsEmpty("QML_XHR_ALLOW_FILE_READ"))
+ qputenv("QML_XHR_ALLOW_FILE_READ", "1");
QQuickView view;
view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
view.setSource(QUrl("qrc:/demos/stocqt/stocqt.qml"));