You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB
C++

#include <QtWidgets/QApplication>
#include <QtQuick/QQuickView>
#include <QtCore/QDir>
#include <QtQml/QQmlEngine>
#include <QSslSocket>
#include <QApplication>
#include "date.h"
#include <QtQml>
int main(int argc, char *argv[])
{
QSurfaceFormat fmt;
fmt.setVersion(3, 1);
fmt.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(fmt);
qmlRegisterType<DateParser>("DateParser", 1, 0, "DateParser");
qDebug() << "Device supports OpenSSL: " << QSslSocket::supportsSsl();
// Qt Charts uses Qt Graphics View Framework for drawing, therefore QApplication must be used.
QApplication app(argc, argv);
QQuickView viewer;
// The following are needed to make examples run without having to install the module
// in desktop environments.
#ifdef Q_OS_WIN
QString extraImportPath(QStringLiteral("%1/../../../../%2"));
#else
QString extraImportPath(QStringLiteral("%1/../../../%2"));
#endif
viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(),
QString::fromLatin1("qml")));
QObject::connect(viewer.engine(), &QQmlEngine::quit, &viewer, &QWindow::close);
viewer.setTitle(QStringLiteral("QML Chart"));
viewer.setSource(QUrl("qrc:/solar-android/main.qml"));
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
viewer.show();
return app.exec();
}