##// END OF EJS Templates
Add toleranceValue method in the SqpSettingsDef class
perrinel -
r533:aa387fab3c40
parent child
Show More
@@ -9,6 +9,10
9 // General settings //
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 extern SCIQLOP_CORE_EXPORT const QString GENERAL_TOLERANCE_AT_INIT_KEY;
16 extern SCIQLOP_CORE_EXPORT const QString GENERAL_TOLERANCE_AT_INIT_KEY;
13 extern SCIQLOP_CORE_EXPORT const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE;
17 extern SCIQLOP_CORE_EXPORT const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE;
14
18
@@ -1,5 +1,16
1 #include "Settings/SqpSettingsDefs.h"
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 const QString GENERAL_TOLERANCE_AT_INIT_KEY = QStringLiteral("toleranceInit");
14 const QString GENERAL_TOLERANCE_AT_INIT_KEY = QStringLiteral("toleranceInit");
4 const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE = 0.2;
15 const double GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE = 0.2;
5
16
General Comments 0
You need to be logged in to leave comments. Login now