making clangd happy and making script to compile/build with run.sh

This commit is contained in:
talksik
2024-02-07 13:12:51 -08:00
commit 45c681e7be
79 changed files with 4235 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "mainwindow.h"
#include <QApplication>
#include <QCommandLineParser>
using namespace Qt::StringLiterals;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setOrganizationName("QtProject"_L1);
QCoreApplication::setApplicationName("DocumentViewer"_L1);
QCoreApplication::setApplicationVersion("1.0"_L1);
QCommandLineParser parser;
parser.setApplicationDescription(QApplication::translate("main",
"A viewer for JSON, PDF and text files"));
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("File"_L1, QApplication::translate("main",
"JSON, PDF or text file to open"));
parser.process(app);
const QStringList &positionalArguments = parser.positionalArguments();
const QString &fileName = (positionalArguments.count() > 0) ? positionalArguments.at(0)
: QString();
MainWindow w;
w.show();
if (!fileName.isEmpty())
w.openFile(fileName);
return app.exec();
}