-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (39 loc) · 1.57 KB
/
Copy pathmain.cpp
File metadata and controls
46 lines (39 loc) · 1.57 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/****************************************************************************
**
** JIWOONG PARK
** Video Annotation Player for fMRI research
** Created: May 12, 2020
** Last Modified: May 12, 2020
**
****************************************************************************/
#include "videoplayer.h"
#include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget>
#include <QtCore/QCommandLineParser>
#include <QtCore/QCommandLineOption>
#include <QtCore/QDir>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setApplicationName("Movie annotationPlayer");
QCoreApplication::setOrganizationName("PECON JWPARK");
QGuiApplication::setApplicationDisplayName(QCoreApplication::applicationName());
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
QCommandLineParser parser;
parser.setApplicationDescription("Movie annotationPlayer");
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("url", "The URL to open.");
parser.process(app);
VideoPlayer player;
if (!parser.positionalArguments().isEmpty()) {
const QUrl url =
QUrl::fromUserInput(parser.positionalArguments().constFirst(),
QDir::currentPath(), QUrl::AssumeLocalFile);
player.setUrl(url);
}
const QRect availableGeometry = QApplication::desktop()->availableGeometry(&player);
player.resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
player.show();
return app.exec();
}