26bool QgsSettingsEntryString::checkValue(
const QString &value )
const
28 if (
value.length() < mMinLength )
30 QgsDebugMsg( QObject::tr(
"Can't set value for settings. String length '%1' is shorter than minimum length '%2'." )
31 .arg(
value.length() )
37 &&
value.length() > mMaxLength )
39 QgsDebugMsg( QObject::tr(
"Can't set value for settings. String length '%1' is longer than maximum length '%2'." )
40 .arg(
value.length() )
48QString QgsSettingsEntryString::convertFromVariant(
const QVariant &value )
const
50 return value.toString();
80QStringList QgsSettingsEntryStringList::convertFromVariant(
const QVariant &value )
const
82 return value.toStringList();
91bool QgsSettingsEntryBool::convertFromVariant(
const QVariant &value )
const
93 return value.toBool();
103bool QgsSettingsEntryInteger::checkValue( qlonglong value )
const
105 if (
value < mMinValue )
107 QgsDebugMsg( QObject::tr(
"Can't set value for setting. Value '%1' is less than minimum value '%2'." )
108 .arg( QString::number(
value ) )
109 .arg( QString::number( mMinValue ) ) );
113 if (
value > mMaxValue )
115 QgsDebugMsg( QObject::tr(
"Can't set value for setting. Value '%1' is greather than maximum value '%2'." )
116 .arg( QString::number(
value ) )
117 .arg( QString::number( mMaxValue ) ) );
124qlonglong QgsSettingsEntryInteger::convertFromVariant(
const QVariant &value )
const
126 return value.toLongLong();
157bool QgsSettingsEntryDouble::checkValue(
double value )
const
159 if (
value < mMinValue )
161 QgsDebugMsg( QObject::tr(
"Can't set value for setting. Value '%1' is less than minimum value '%2'." )
162 .arg( QString::number(
value ) )
163 .arg( QString::number( mMinValue ) ) );
167 if (
value > mMaxValue )
169 QgsDebugMsg( QObject::tr(
"Can't set value for setting. Value '%1' is greather than maximum value '%2'." )
170 .arg( QString::number(
value ) )
171 .arg( QString::number( mMaxValue ) ) );
178double QgsSettingsEntryDouble::convertFromVariant(
const QVariant &value )
const
180 return value.toDouble();
215 return mDisplayHintDecimals;
219QColor QgsSettingsEntryColor::convertFromVariant(
const QVariant &value )
const
221 return value.value<QColor>();
SettingsType
Types of settings entries.
@ Variant
Generic variant.
@ StringList
List of strings.
@ Double
Double precision number.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
QString value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
bool value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
void setDisplayHintDecimals(int displayHintDecimals)
Set the display hint decimals.
int displayHintDecimals() const
Returns how much decimals should be shown in the Gui.
double minValue() const
Returns the minimum value.
void setMinValue(double minValue)
Set the minimum value.
double maxValue() const
Returns the maximum value.
void setMaxValue(double maxValue)
Set the maximum value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
qlonglong maxValue() const
Returns the maximum value.
qlonglong minValue() const
Returns the minimum value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
void setMaxValue(qlonglong maxValue)
Set the maximum value.
void setMinValue(qlonglong minValue)
Set the minimum value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
int maxLength() const
Returns the string maximum length.
int minLength() const
Returns the string minimum length.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
void setMinLength(int minLength)
Set the string minimum length.
void setMaxLength(int maxLength)
Set the string maximum length.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.