2018-05-10 16:41:14 +00:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
2019-01-30 07:53:19 +00:00
|
|
|
#include <QCommandLineParser>
|
2018-05-10 16:41:14 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
QApplication app(argc, argv);
|
2019-01-30 07:53:19 +00:00
|
|
|
QCoreApplication::setApplicationName("ESGRAF 4-8");
|
|
|
|
QCoreApplication::setApplicationVersion("0.1");
|
|
|
|
|
|
|
|
QCommandLineParser cmdParser;
|
|
|
|
cmdParser.setApplicationDescription("ESGRAF 4-8");
|
|
|
|
cmdParser.addHelpOption();
|
|
|
|
cmdParser.addVersionOption();
|
|
|
|
cmdParser.addPositionalArgument("filename", "file to open");
|
|
|
|
|
|
|
|
cmdParser.process(app);
|
|
|
|
|
|
|
|
const QStringList args = cmdParser.positionalArguments();
|
2018-12-02 14:22:44 +00:00
|
|
|
|
|
|
|
std::unique_ptr<MainWindow> mainWindow;
|
2019-01-30 07:53:19 +00:00
|
|
|
if (args.empty())
|
2018-12-02 14:22:44 +00:00
|
|
|
{
|
|
|
|
mainWindow = std::make_unique<MainWindow>(nullptr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-30 07:53:19 +00:00
|
|
|
mainWindow = std::make_unique<MainWindow>(nullptr, args.at(0));
|
2018-12-02 14:22:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mainWindow->show();
|
2018-05-10 16:41:14 +00:00
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|