2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2016-07-06 11:04:07 +00:00
|
|
|
|
2016-07-26 12:15:31 +00:00
|
|
|
#include <QGuiApplication>
|
2016-07-06 11:04:07 +00:00
|
|
|
#include <QFontDatabase>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QQmlContext>
|
|
|
|
#include <QQuickStyle>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QGuiApplication::setApplicationName("Text Editor");
|
|
|
|
QGuiApplication::setOrganizationName("QtProject");
|
|
|
|
|
2016-07-26 12:15:31 +00:00
|
|
|
QGuiApplication app(argc, argv);
|
2016-07-06 11:04:07 +00:00
|
|
|
|
2020-11-02 18:41:19 +00:00
|
|
|
if (QFontDatabase::addApplicationFont(":/fonts/fontello.ttf") == -1)
|
2016-07-06 11:04:07 +00:00
|
|
|
qWarning() << "Failed to load fontello.ttf";
|
|
|
|
|
2016-09-03 10:42:17 +00:00
|
|
|
QStringList selectors;
|
2016-07-26 12:15:31 +00:00
|
|
|
#ifdef QT_EXTRA_FILE_SELECTOR
|
2016-09-03 10:42:17 +00:00
|
|
|
selectors += QT_EXTRA_FILE_SELECTOR;
|
|
|
|
#else
|
|
|
|
if (app.arguments().contains("-touch"))
|
|
|
|
selectors += "touch";
|
2016-07-26 12:15:31 +00:00
|
|
|
#endif
|
2016-09-03 10:42:17 +00:00
|
|
|
|
|
|
|
QQmlApplicationEngine engine;
|
2021-10-20 14:06:47 +00:00
|
|
|
engine.setExtraFileSelectors(selectors);
|
2016-09-03 10:42:17 +00:00
|
|
|
|
2016-07-06 11:04:07 +00:00
|
|
|
engine.load(QUrl("qrc:/qml/texteditor.qml"));
|
|
|
|
if (engine.rootObjects().isEmpty())
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|