18#include <QApplication>
19#include <QCommandLineParser>
21#include <QIODeviceBase>
23#include "src/ui/windows/MainWindow.hpp"
24#include "src/ui/windows/RecentFilesDialog.hpp"
26int main(
int argc,
char *argv[])
28 QApplication app(argc, argv);
29 QApplication::setApplicationName(
"Motiv");
30 QApplication::setApplicationVersion(MOTIV_VERSION_STRING);
31 QApplication::setWindowIcon(QIcon(
":/res/motiv.png"));
34 QFile styleFile(
":/res/style.qss" );
35 styleFile.open( QFile::ReadOnly );
38 QString style( styleFile.readAll() );
39 app.setStyleSheet( style );
41 QCommandLineParser parser;
42 parser.setApplicationDescription(
"Visualizer for OTF2 trace files");
44 QCommandLineOption helpOption = parser.addHelpOption();
45 QCommandLineOption versionOption = parser.addVersionOption();
46 parser.addPositionalArgument(
"file", QCoreApplication::translate(
"main",
"filepath of the .otf2 trace file to open"),
"[file]");
50 if (parser.isSet(helpOption) || parser.isSet(versionOption)) {
54 QStringList positionalArguments = parser.positionalArguments();
56 if (!positionalArguments.isEmpty()) {
57 filepath = positionalArguments.first();
61 if(!filepath.isEmpty() || recentFilesDialog.exec() == QDialog::Accepted) {
The main window of the application.
A dialog that displays an open button and previously opened trace files.