diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index dc03dcbb8..754d4f71e 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -470,8 +470,13 @@ void MainApplication::reloadSettings() QString MainApplication::styleName() const { - QProxyStyle *proxyStyle = qobject_cast(style()); - return proxyStyle ? proxyStyle->baseStyle()->objectName() : style()->objectName(); + return m_proxyStyle ? m_proxyStyle->name() : QString(); +} + +void MainApplication::setProxyStyle(ProxyStyle *style) +{ + m_proxyStyle = style; + setStyle(style); } QString MainApplication::currentLanguageFile() const diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index 549ed72a1..ba6af3435 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -48,6 +48,7 @@ class SearchEnginesManager; class HTML5PermissionsManager; class RegisterQAppAssociation; class DesktopNotificationsFactory; +class ProxyStyle; class QUPZILLA_EXPORT MainApplication : public QtSingleApplication { @@ -84,6 +85,7 @@ public: // Name of current Qt style QString styleName() const; + void setProxyStyle(ProxyStyle *style); QString currentLanguageFile() const; QString currentLanguage() const; @@ -175,6 +177,7 @@ private: QWebEngineProfile* m_webProfile; AutoSaver* m_autoSaver; + ProxyStyle *m_proxyStyle = nullptr; QList m_windows; QPointer m_lastActiveWindow; diff --git a/src/main/main.cpp b/src/main/main.cpp index bd5345e89..6d313897f 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -150,7 +150,7 @@ int main(int argc, char* argv[]) if (app.isClosing()) return 0; - app.setStyle(new ProxyStyle); + app.setProxyStyle(new ProxyStyle); return app.exec(); }