-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.cpp
50 lines (37 loc) · 2.38 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <QGuiApplication>
#include <QCoreApplication>
#include <QUrl>
#include <QString>
#include <QQuickStyle>
#include <QQmlEngine>
#include <QQmlContext>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include <QVector>
#include <QtWebEngine/qtwebengineglobal.h>
int main(int argc, char** argv) {
QGuiApplication::setOrganizationName("youtube-web.mateo-salta");
QGuiApplication::setApplicationName("youtube-web.mateo-salta");
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
// qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "true");
/* if (qgetenv("QT_QPA_PLATFORM") == "wayland") {
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "wl-shell");
qputenv("QT_SCALE_FACTOR", "1.7");
qputenv("QT_WEBENGINE_DISABLE_GPU","1");
} */
const auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags + " --simulate-touch-screen-with-mouse --touch-events=enabled --enable-features=OverlayScrollbar,kEnableQuic,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter --enable-blink-features=NeverSlowMode,BackFowardCache,Canvas2dScrollPathIntoView,BackForwardCacheExperimentHTTPHeader,Accelerated2dCanvas,AcceleratedSmallCanvases --enable-smooth-scrolling --disable-low-res-tiling --enable-gpu --enable-gpu-rasterization --enable-zero-copy --adaboost --enable-gpu-msemory-buffer-video-frames --font-render-hinting=none --disable-font-subpixel-positioning --disable-new-content-rendering-timeout --enable-defer-all-script-without-optimization-hints --enable-gpu-vsync --enable-oop-rasterization --enable-accelerated-video-decode ");
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--blink-settings=darkMode=3,darkModeImagePolicy=2,darkModeImageStyle=2 --enable-smooth-scrolling --enable-low-res-tiling --enable-low-end-device-mode --enable-natural-scroll-default");
//qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "");
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Suru");
QQmlApplicationEngine engine(QUrl("qrc:///app/Main.qml"));
/* QQuickView view;
view.setFlags(Qt::Window | Qt::WindowTitleHint);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setColor(Qt::black);
view.setSource(QUrl("qrc:///app/Main.qml"));
view.show(); */
return app.exec();
}