mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Port to Qt5 on GNU/Linux
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user