forked from giovannic96/Real-time-collaborative-text-editor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (37 loc) · 1.91 KB
/
Copy pathmain.cpp
File metadata and controls
46 lines (37 loc) · 1.91 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
#include <boost/asio.hpp>
#include "startwindow.h"
#include <QTextCodec>
#include <QApplication>
int main(int argc, char *argv[]){
qRegisterMetaType<std::pair<int,wchar_t>>("std::pair<int,wchar_t>");
qRegisterMetaType<std::string>("std::string");
qRegisterMetaType<symbolStyle>("symbolStyle");
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
/*
* FOLLOWING COMMENTED LINE IS FOR DPI SCALING -> IT DOESN'T WORK FOR ME. Check yourself with your monitor
* I tryed to copy this line in the constructor of EditorWindow, it doesn't work too!
* This is big smoking shit! Can't find a solution.
* @rinaldoclemente suggest to use image instead of text, but I (HidroSaphire) don't like it as solution
*
* Futhermore, I discover that is a Well Known Bug of Qt
* See this and https://bugreports.qt.io/browse/QTBUG-53022
*
QApplication::setAttribute(Qt::AA_Use96Dpi);
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1")); //Deprecated in Qt 5.6
qputenv("QT_SCALE_FACTORS", "2");
qputenv("QT_AUTO_SCREEN_SCALE_FACTORS", "2");
*/
//The Following 4 lines is crucial and NECESSARY for class "settings". Is the path for Register in Windows (or .ini file in \AppData\Roaming)
QCoreApplication::setOrganizationName("C.A.R.T.E. Studio");
QCoreApplication::setOrganizationDomain("https://github.com/giovannic96/Real-time-collaborative-text-editor");
QCoreApplication::setApplicationName("C.A.R.T.E.");
QSettings settingsH;
//Launch the application
QApplication a(argc, argv);
//Building first window (login). //TODO --> Add a splashscreen
StartWindow w;
w.show();
return a.exec(); //Starting point of the event loop of "thread GUI" (or primary thread)
}