2023-03-02 13:45:23 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2023-05-09 07:38:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
#include <QtCore/QDir>
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtGui/QGuiApplication>
|
2023-03-02 13:45:23 +00:00
|
|
|
#include <QtQml/QQmlEngine>
|
2023-10-12 06:37:46 +00:00
|
|
|
#include <QtQuick/QQuickView>
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
|
|
QQuickView viewer;
|
|
|
|
|
|
2023-10-12 06:37:46 +00:00
|
|
|
// The following are needed to make examples run without having to install the
|
|
|
|
|
// module in desktop environments.
|
2023-03-02 13:45:23 +00:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
QString extraImportPath(QStringLiteral("%1/../../../../%2"));
|
|
|
|
|
#else
|
|
|
|
|
QString extraImportPath(QStringLiteral("%1/../../../%2"));
|
|
|
|
|
#endif
|
2023-10-12 06:37:46 +00:00
|
|
|
viewer.engine()->addImportPath(
|
|
|
|
|
extraImportPath.arg(QGuiApplication::applicationDirPath(), QString::fromLatin1("qml")));
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
viewer.setTitle(QStringLiteral("Simple Scatter Graph"));
|
|
|
|
|
|
2023-12-04 13:59:46 +00:00
|
|
|
//! [0]
|
2023-04-18 11:01:54 +00:00
|
|
|
viewer.setSource(QUrl("qrc:/qml/scatter/main.qml"));
|
2023-12-04 13:59:46 +00:00
|
|
|
//! [0]
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
|
|
|
|
2023-12-04 13:59:46 +00:00
|
|
|
viewer.show();
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
|
}
|