-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (26 loc) · 976 Bytes
/
main.cpp
File metadata and controls
31 lines (26 loc) · 976 Bytes
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
// Copyright (C) 2025 Pedro López-Cabanillas
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QApplication>
#include <QCommandLineParser>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("RiffTreeGUI");
QCoreApplication::setOrganizationDomain("pedrolcl.github.io");
QCoreApplication::setApplicationName(QT_STRINGIFY(PROGRAM));
QCoreApplication::setApplicationVersion(QT_STRINGIFY(VERSION));
QApplication app(argc, argv);
QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("file", "RIFF file");
parser.process(app);
// Retrieve command line arguments from Qt and parse options
QStringList args = parser.positionalArguments();
MainWindow mainwin;
mainwin.show();
if (args.size() > 0) {
mainwin.openFile(args.first());
}
return QCoreApplication::exec();
}