QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
26 bool 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() )
48 QString QgsSettingsEntryString::convertFromVariant(
const QVariant &value )
const
50 return value.toString();
80 QStringList QgsSettingsEntryStringList::convertFromVariant(
const QVariant &value )
const
82 return value.toStringList();
91 bool QgsSettingsEntryBool::convertFromVariant(
const QVariant &value )
const
93 return value.toBool();
103 bool 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 ) ) );
124 qlonglong QgsSettingsEntryInteger::convertFromVariant(
const QVariant &value )
const
126 return value.toLongLong();
157 bool 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 ) ) );
178 double QgsSettingsEntryDouble::convertFromVariant(
const QVariant &value )
const
180 return value.toDouble();
215 return mDisplayHintDecimals;
219 QColor QgsSettingsEntryColor::convertFromVariant(
const QVariant &value )
const
221 return value.value<QColor>();
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
void setMaxValue(qlonglong maxValue)
Set the maximum value.
void setDisplayHintDecimals(int displayHintDecimals)
Set the display hint decimals.
double maxValue() const
Returns the maximum value.
void setMinValue(double minValue)
Set the minimum value.
@ Double
Double precision number.
int maxLength() const
Returns the string maximum length.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
qlonglong minValue() const
Returns the minimum value.
int minLength() const
Returns the string minimum length.
int displayHintDecimals() const
Returns how much decimals should be shown in the Gui.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
SettingsType
Types of settings entries.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
@ Variant
Generic variant.
@ StringList
List of strings.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
double minValue() const
Returns the minimum value.
void setMaxLength(int maxLength)
Set the string maximum length.
QString value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
void setMaxValue(double maxValue)
Set the maximum value.
void setMinLength(int minLength)
Set the string minimum length.
qlonglong maxValue() const
Returns the maximum value.
void setMinValue(qlonglong minValue)
Set the minimum value.
virtual Qgis::SettingsType settingsType() const override
Returns the settings entry type.
bool value(const QString &dynamicKeyPart=QString()) const
Returns settings value.