23 lines
788 B
C++
23 lines
788 B
C++
#include "imageviewer.h"
|
|
#include <QApplication>
|
|
#include <QCommandLineParser>
|
|
#include <pylon/PylonIncludes.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
QGuiApplication::setApplicationDisplayName(ImageViewer::tr("Image Viewer"));
|
|
QCommandLineParser commandLineParser;
|
|
commandLineParser.addHelpOption();
|
|
commandLineParser.addPositionalArgument(ImageViewer::tr("[file]"), ImageViewer::tr("Image file to open."));
|
|
commandLineParser.process(QCoreApplication::arguments());
|
|
ImageViewer imageViewer;
|
|
if (!commandLineParser.positionalArguments().isEmpty()
|
|
&& !imageViewer.loadFile(commandLineParser.positionalArguments().front())) {
|
|
return -1;
|
|
}
|
|
imageViewer.show();
|
|
int ret = app.exec();
|
|
return ret;
|
|
}
|