-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
33 lines (28 loc) · 883 Bytes
/
main.cpp
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
#include "mainwindow.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QWebEnginePage>
#include <QWebEngineNavigationRequest>
#include <QDir>
#include "celerrequestinterceptor.h"
#include <QWebEngineUrlScheme>
#include <QWebEngineProfile>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, false);
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-zero-copy");
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "celerbrowser_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
MainWindow w;
w.show();
return a.exec();
}