forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmlconfigproxy.h
39 lines (31 loc) · 1.06 KB
/
qmlconfigproxy.h
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
#pragma once
#include <QColor>
#include <QObject>
#include <QVariantList>
#include <QtQml>
#include "preferences/usersettings.h"
namespace mixxx {
namespace qml {
class QmlConfigProxy : public QObject {
Q_OBJECT
QML_NAMED_ELEMENT(Config)
QML_SINGLETON
public:
explicit QmlConfigProxy(
UserSettingsPointer pConfig,
QObject* parent = nullptr);
// We use method here instead of properties as there is no way to achieve property binding
// with UserSettings, since there is no synchronisation upon mutations.
Q_INVOKABLE QVariantList getHotcueColorPalette();
Q_INVOKABLE QVariantList getTrackColorPalette();
Q_INVOKABLE int getMultiSamplingLevel();
static QmlConfigProxy* create(QQmlEngine* pQmlEngine, QJSEngine* pJsEngine);
static inline void registerUserSettings(UserSettingsPointer pConfig) {
s_pUserSettings = std::move(pConfig);
}
private:
static inline UserSettingsPointer s_pUserSettings = nullptr;
const UserSettingsPointer m_pConfig;
};
} // namespace qml
} // namespace mixxx