Port to Qt5 on GNU/Linux

This commit is contained in:
Alexandre Quessy
2014-10-16 21:27:06 -04:00
parent 7e89ee4ed7
commit ecf0efe956
5 changed files with 36 additions and 5 deletions
+25
View File
@@ -3,6 +3,9 @@
#include <iostream>
#include <QTranslator>
#include <QtGui>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QDebug>
#include "MM.h"
#include "MainWindow.h"
#include "MainApplication.h"
@@ -42,9 +45,25 @@ int main(int argc, char *argv[])
MainApplication app(argc, argv);
QCommandLineParser parser;
parser.setApplicationDescription("Video mapping editor");
const QCommandLineOption helpOption = parser.addHelpOption();
const QCommandLineOption versionOption = parser.addVersionOption();
// A boolean option for running it via GUI (--gui)
QCommandLineOption fullscreenOption(QStringList() << "f" << "fullscreen",
"Display the output window and make it fullscreen.");
parser.addOption(fullscreenOption);
parser.process(app);
if (parser.isSet(versionOption) || parser.isSet(helpOption))
{
return 0;
}
if (!QGLFormat::hasOpenGL())
qFatal("This system has no OpenGL support.");
// Create splash screen.
QPixmap pixmap("splash.png");
QSplashScreen splash(pixmap);
@@ -86,6 +105,12 @@ int main(int argc, char *argv[])
splash.finish(&win);
splash.raise();
if (parser.isSet(fullscreenOption))
{
qDebug() << "TODO: Running in fullscreen mode";
win.enableFullscreen();
}
// Launch program.
win.show();