With 6e77da640aa84c1efe330d4a5224c9c7425ece57, the documentviewer demo's TxtViewer plugin has been fully documented in order to replace the Application example. This patch moves the application example to manual tests. Pick-to: 6.5 Change-Id: I67d975e478c7bc840613c8af1301a4eafe8f1a42 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
31 lines
944 B
C++
31 lines
944 B
C++
// Copyright (C) 2016 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#include <QApplication>
|
|
#include <QCommandLineParser>
|
|
#include <QCommandLineOption>
|
|
|
|
#include "mainwindow.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
Q_INIT_RESOURCE(application);
|
|
|
|
QApplication app(argc, argv);
|
|
QCoreApplication::setOrganizationName("QtProject");
|
|
QCoreApplication::setApplicationName("Application Example");
|
|
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
|
|
QCommandLineParser parser;
|
|
parser.setApplicationDescription(QCoreApplication::applicationName());
|
|
parser.addHelpOption();
|
|
parser.addVersionOption();
|
|
parser.addPositionalArgument("file", "The file to open.");
|
|
parser.process(app);
|
|
|
|
MainWindow mainWin;
|
|
if (!parser.positionalArguments().isEmpty())
|
|
mainWin.loadFile(parser.positionalArguments().first());
|
|
mainWin.show();
|
|
return app.exec();
|
|
}
|