Auto status change to "Under Review"
@@ -1,18 +1,22 | |||
|
1 | 1 | #ifndef SCIQLOP_SQPSETTINGSDEFS_H |
|
2 | 2 | #define SCIQLOP_SQPSETTINGSDEFS_H |
|
3 | 3 | |
|
4 | 4 | #include "CoreGlobal.h" |
|
5 | 5 | |
|
6 | 6 | #include <QString> |
|
7 | 7 | |
|
8 | 8 | // //////////////// // |
|
9 | 9 | // General settings // |
|
10 | 10 | // //////////////// // |
|
11 | 11 | |
|
12 | ||
|
13 | struct SCIQLOP_CORE_EXPORT SqpSettings { | |
|
14 | static double toleranceValue(const QString &key, double defaultValue) noexcept; | |
|
15 | }; | |
|
12 | 16 | extern SCIQLOP_CORE_EXPORT const QString GENERAL_TOLERANCE_AT_INIT_KEY; |
|
13 | 17 | extern SCIQLOP_CORE_EXPORT const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE; |
|
14 | 18 | |
|
15 | 19 | extern SCIQLOP_CORE_EXPORT const QString GENERAL_TOLERANCE_AT_UPDATE_KEY; |
|
16 | 20 | extern SCIQLOP_CORE_EXPORT const double GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE; |
|
17 | 21 | |
|
18 | 22 | #endif // SCIQLOP_SQPSETTINGSDEFS_H |
@@ -1,7 +1,18 | |||
|
1 | 1 | #include "Settings/SqpSettingsDefs.h" |
|
2 | 2 | |
|
3 | #include <QSettings> | |
|
4 | ||
|
5 | ||
|
6 | /// Gets a tolerance value from application settings. If the setting can't be found, the default | |
|
7 | /// value passed in parameter is returned | |
|
8 | double SqpSettings::toleranceValue(const QString &key, double defaultValue) noexcept | |
|
9 | { | |
|
10 | return QSettings{}.value(key, defaultValue).toDouble(); | |
|
11 | } | |
|
12 | ||
|
13 | ||
|
3 | 14 | const QString GENERAL_TOLERANCE_AT_INIT_KEY = QStringLiteral("toleranceInit"); |
|
4 | 15 | const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE = 0.2; |
|
5 | 16 | |
|
6 | 17 | const QString GENERAL_TOLERANCE_AT_UPDATE_KEY = QStringLiteral("toleranceUpdate"); |
|
7 | 18 | const double GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE = 0.2; |
General Comments 1
You need to be logged in to leave comments.
Login now