-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathaogproperty.h
53 lines (42 loc) · 1.51 KB
/
aogproperty.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (C) 2024 Michael Torrie and the QtAgOpenGPS Dev Team
// SPDX-License-Identifier: GNU General Public License v3.0 or later
//
// I'm going to attempt my documentation in the backend. I'm rather lost there, still. If something is wrong, please fix it.
// I will only document in the .h files, unless several .cpp's are using one .h (like formgps.h)
//
// Settings wrapper class tie-in
#ifndef AOGPROPERTY_H
#define AOGPROPERTY_H
#include <QVector>
#include <QVariant>
class AOGSettings;
extern AOGSettings *settings;
class AOGProperty
{
protected:
const QString key;
const QVariant default_value;
const QVector<int> default_list;
public:
inline static QMap<QString, QVariant> default_map;
static void add_default_map (const QString &key, const QVariant &default_value);
static void init_defaults();
AOGProperty(const QString key, const QVariant &defaultvalue);
AOGProperty(const QString key, const QVector<int> &defaultvalue);
operator int();
operator char();
operator double();
operator QString();
operator bool();
operator float();
operator QColor();
//special case for QVector<int>. In AOGSettings, this type is marshalled as
//a QVariantList so that the ini file has human-readable text in it.
operator QVector<int>();
QVariant value(void);
AOGProperty &operator=(QVariant newvalue);
AOGProperty &operator=(QVector<int> newvalue);
};
extern AOGProperty property_environment_last_name;
#include "properties.h"
#endif // AOGPROPERTY_H