|
23 | 23 | #include "qgis_sip.h"
|
24 | 24 | #include "qgssettings.h"
|
25 | 25 |
|
| 26 | +#define QGS_SETTING_ENTRY_VARIANT(name, path, section, defaultValue, ...) \ |
| 27 | + struct name : public QgsSettingsEntry\ |
| 28 | + { name() : QgsSettingsEntry( path, section, defaultValue, ##__VA_ARGS__ ) {} }; |
| 29 | + |
26 | 30 | /**
|
27 | 31 | * \ingroup core
|
28 | 32 | * \class QgsSettingsEntry
|
29 | 33 | *
|
30 | 34 | * Represent settings entry and provides methods for reading and writing settings values.
|
31 |
| - * Different subclasses are provided for differents settings types with metainformations |
| 35 | + * Different subclasses are provided for different settings types with metainformations |
32 | 36 | * to validate set values and provide more accurate settings description for the gui.
|
33 | 37 | *
|
34 | 38 | * \since QGIS 3.20
|
@@ -204,7 +208,7 @@ class CORE_EXPORT QgsSettingsEntryString : public QgsSettingsEntry
|
204 | 208 | * The \a default value argument specifies the default value for the settings entry.
|
205 | 209 | * The \a description argument specifies a description for the settings entry.
|
206 | 210 | * The \a minLength argument specifies the minimal length of the string value.
|
207 |
| - * The \a maxLength argument specifies the maximal lenght of the string value. |
| 211 | + * The \a maxLength argument specifies the maximal length of the string value. |
208 | 212 | * By -1 the there is no limit
|
209 | 213 | */
|
210 | 214 | QgsSettingsEntryString( const QString &key,
|
@@ -341,8 +345,8 @@ class CORE_EXPORT QgsSettingsEntryInteger : public QgsSettingsEntry
|
341 | 345 | QgsSettings::Section section,
|
342 | 346 | qlonglong defaultValue = 0,
|
343 | 347 | const QString &description = QString(),
|
344 |
| - qlonglong minValue = -__LONG_LONG_MAX__ + 1, |
345 |
| - qlonglong maxValue = __LONG_LONG_MAX__ ); |
| 348 | + qlonglong minValue = std::numeric_limits<qlonglong>::min(), |
| 349 | + qlonglong maxValue = std::numeric_limits<qlonglong>::max() ); |
346 | 350 |
|
347 | 351 | //! \copydoc QgsSettingsEntry::setValue
|
348 | 352 | bool setValue( const QVariant &value, const QString &dynamicKeyPart = QString() ) override;
|
@@ -397,8 +401,8 @@ class CORE_EXPORT QgsSettingsEntryDouble : public QgsSettingsEntry
|
397 | 401 | QgsSettings::Section section,
|
398 | 402 | double defaultValue = 0.0,
|
399 | 403 | const QString &description = QString(),
|
400 |
| - double minValue = __DBL_MIN__, |
401 |
| - double maxValue = __DBL_MAX__, |
| 404 | + double minValue = std::numeric_limits<double>::min(), |
| 405 | + double maxValue = std::numeric_limits<double>::max(), |
402 | 406 | double displayDecimals = 1 );
|
403 | 407 |
|
404 | 408 | //! \copydoc QgsSettingsEntry::setValue
|
|
0 commit comments