-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (43 loc) · 1.66 KB
/
Copy pathmain.cpp
File metadata and controls
49 lines (43 loc) · 1.66 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
47
48
49
// File: main.cpp
/*
Pep9CPU is a CPU simulator for executing microcode sequences to
implement instructions in the instruction set of the Pep/9 computer.
Copyright (C) 2010 J. Stanley Warford, Pepperdine University
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtWidgets/QApplication>
#include "mainwindow.h"
#ifdef WIN32
#include <string.h>
#include <qvector.h>
#endif
int main(int argc, char *argv[])
{
#ifdef WIN32 //Always inject -platform windows:dpiawareness=0 flag to disable hi-dpi support.
//Hi-dpi support makes all of the pixel arithmatic break.
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling,true);
std::vector<char*> new_argv(argv, argv + argc);
char* string = new char[10];
strncpy(string, "-platform",10);
new_argv.push_back(string);
string = new char[23];
strncpy(string, "windows:dpiawareness=0",23);
new_argv.push_back(string);
new_argv.push_back(nullptr);
argv = &new_argv.data()[0];
argc+=2;
#endif
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}