-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (34 loc) · 1.04 KB
/
Copy pathmain.cpp
File metadata and controls
41 lines (34 loc) · 1.04 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
#include "mainwindow.h"
#include <QCommandLineParser>
#include <QApplication>
#include <QDesktopWidget>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCommandLineParser parser;
parser.setApplicationDescription("Key Cw From Mouse");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption cCharSpeed("c", "Character Speed", "...");
QCommandLineOption fFarnSpeed("f", "Farnsword Speed", "...");
QCommandLineOption tTone("t", "Tone", "...");
cCharSpeed.setDefaultValue("20");
fFarnSpeed.setDefaultValue("20");
tTone.setDefaultValue("650");
parser.addOption(cCharSpeed);
parser.addOption(fFarnSpeed);
parser.addOption(tTone);
parser.process(a);
MainWindow w;
w.setParameters
(
parser.value(cCharSpeed).toInt(),
parser.value(fFarnSpeed).toInt(),
parser.value(tTone).toInt()
);
int deskWidth = QApplication::desktop()->screenGeometry().width();
w.setWindowFlags(w.windowFlags() | Qt::FramelessWindowHint);
w.setGeometry(0,0,deskWidth,w.height());
w.show();
return a.exec();
}