-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
51 lines (38 loc) · 1.2 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Copyright (c) 2020-2021 DigitalBox
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
*/
// Qt
#include <QtWidgets>
// BreizhEdit
#include "customapplication.h"
#include "mainwindow.h"
/**
* @brief main
* @param argc
* @param argv
* @return
*/
int main(int argc, char *argv[])
{
CustomApplication app(argc, argv);
//QApplication app(argc, argv);
QCoreApplication::setOrganizationName("DigitalBox");
QCoreApplication::setApplicationName("BreizhEdit");
QCoreApplication::setApplicationVersion(EDITOR_VERSION);
// Define command line options and arguments
QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::applicationName());
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("file", "The file to open.");
parser.process(app);
MainWindow window;
app.setMainWindow(&window);
// Load file if specified
if (!parser.positionalArguments().isEmpty())
window.fileLoad(parser.positionalArguments().first());
window.show();
return app.exec();
}