Changeset View
Changeset View
Standalone View
Standalone View
src/platformtheme/kdeplatformtheme.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | |||||
91 | #if HAVE_X11 | 91 | #if HAVE_X11 | ||
92 | if (KWindowSystem::isPlatformX11()) { | 92 | if (KWindowSystem::isPlatformX11()) { | ||
93 | m_x11Integration.reset(new X11Integration()); | 93 | m_x11Integration.reset(new X11Integration()); | ||
94 | m_x11Integration->init(); | 94 | m_x11Integration->init(); | ||
95 | } | 95 | } | ||
96 | #endif | 96 | #endif | ||
97 | 97 | | |||
98 | QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false); | 98 | QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false); | ||
99 | setQtQuickControlsTheme(); | ||||
99 | } | 100 | } | ||
100 | 101 | | |||
101 | KdePlatformTheme::~KdePlatformTheme() | 102 | KdePlatformTheme::~KdePlatformTheme() | ||
102 | { | 103 | { | ||
103 | delete m_fontsData; | 104 | delete m_fontsData; | ||
104 | delete m_hints; | 105 | delete m_hints; | ||
105 | } | 106 | } | ||
106 | 107 | | |||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Line(s) | 355 | if (isDBusGlobalMenuAvailable()) { | |||
385 | 386 | | |||
386 | return menu; | 387 | return menu; | ||
387 | } | 388 | } | ||
388 | 389 | | |||
389 | return nullptr; | 390 | return nullptr; | ||
390 | } | 391 | } | ||
391 | #endif | 392 | #endif | ||
392 | 393 | | |||
394 | //force QtQuickControls2 to use the desktop theme as default | ||||
395 | void KdePlatformTheme::setQtQuickControlsTheme() | ||||
396 | { | ||||
397 | //if the user has explicitly set something else, don't meddle | ||||
398 | if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")) { | ||||
399 | return; | ||||
400 | } | ||||
401 | //if the user is running only a QGuiApplication. Abort as this style is all about QWidgets and we know setting this will make it crash | ||||
402 | if (!qobject_cast<QApplication*>(qApp)) { | ||||
403 | return; | ||||
404 | } | ||||
405 | qputenv("QT_QUICK_CONTROLS_STYLE", "org.kde.desktop"); | ||||
406 | } | ||||
407 | | ||||
393 | #include "kdeplatformtheme.moc" | 408 | #include "kdeplatformtheme.moc" |