refactor: some Application & style things (#5561)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
# include <QStyleHints>
|
||||
#endif
|
||||
#include <QApplication>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -301,8 +302,9 @@ Theme::Theme(const Paths &paths)
|
||||
this->loadAvailableThemes(paths);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
QObject::connect(qApp->styleHints(), &QStyleHints::colorSchemeChanged,
|
||||
&this->lifetime_, [this] {
|
||||
QObject::connect(QApplication::styleHints(),
|
||||
&QStyleHints::colorSchemeChanged, &this->lifetime_,
|
||||
[this] {
|
||||
if (this->isSystemTheme())
|
||||
{
|
||||
this->update();
|
||||
@@ -320,7 +322,7 @@ void Theme::update()
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
if (this->isSystemTheme())
|
||||
{
|
||||
switch (qApp->styleHints()->colorScheme())
|
||||
switch (QApplication::styleHints()->colorScheme())
|
||||
{
|
||||
case Qt::ColorScheme::Light:
|
||||
return this->lightSystemThemeName;
|
||||
|
||||
Reference in New Issue
Block a user