Sine Striker
2023-12-22 436e8326effba6678a6a5dc47e94cdded6f3a080
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
#include "styleagent.h"
#include "styleagent_p.h"
 
#include <QtCore/QVariant>
 
namespace QWK {
 
    StyleAgentPrivate::StyleAgentPrivate() {
    }
 
    StyleAgentPrivate::~StyleAgentPrivate() {
        removeSystemThemeHook();
    }
 
    void StyleAgentPrivate::init() {
        setupSystemThemeHook();
    }
 
    void StyleAgentPrivate::notifyThemeChanged(StyleAgent::SystemTheme theme) {
        if (theme == systemTheme)
            return;
        systemTheme = theme;
 
        Q_Q(StyleAgent);
        Q_EMIT q->systemThemeChanged();
    }
 
    StyleAgent::StyleAgent(QObject *parent) : StyleAgent(*new StyleAgentPrivate(), parent) {
    }
 
    StyleAgent::~StyleAgent() {
    }
 
    StyleAgent::SystemTheme StyleAgent::systemTheme() const {
        Q_D(const StyleAgent);
        return d->systemTheme;
    }
 
    StyleAgent::StyleAgent(StyleAgentPrivate &d, QObject *parent) : QObject(parent), d_ptr(&d) {
        d.q_ptr = this;
 
        d.init();
    }
 
}