-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
executable file
·39 lines (31 loc) · 977 Bytes
/
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
#include "mainwindow.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QFileInfo>
int main(int argc, char *argv[]) {
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QApplication::setApplicationName("Qldd");
QApplication::setApplicationVersion(PROJECT_VERSION);
QCommandLineParser parser;
parser.setApplicationDescription("Qldd gui over ldd utility");
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "file analyse."));
parser.process(app);
const QStringList args = parser.positionalArguments();
QString fName;
if (!args.empty()) {
fName = args.at(0);
}
MainWindow w(fName);
QString title = "DependencyViewer";
if (!fName.isEmpty()) {
QFileInfo fi(fName);
auto s = QString(" - %1").arg(fi.fileName());
title.append(s);
}
w.setWindowTitle(title);
w.show();
return app.exec();
}