mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
const of QgsProperty and some styling
This commit is contained in:
parent
8824d06dd3
commit
7c0d3b5829
@ -430,7 +430,7 @@ implying a hierarchy of keys and corresponding values
|
|||||||
int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok = 0 ) const;
|
int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok = 0 ) const;
|
||||||
double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok = 0 ) const;
|
double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok = 0 ) const;
|
||||||
bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok = 0 ) const;
|
bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok = 0 ) const;
|
||||||
QgsProperty readPropertyEntry( const QString &scope, const QString &key, QgsProperty def = QgsProperty(), bool *ok = 0 ) const;
|
QgsProperty readPropertyEntry( const QString &scope, const QString &key, const QgsProperty &def = QgsProperty(), bool *ok = 0 ) const;
|
||||||
|
|
||||||
|
|
||||||
bool removeEntry( const QString &scope, const QString &key );
|
bool removeEntry( const QString &scope, const QString &key );
|
||||||
|
@ -2488,20 +2488,20 @@ bool QgsProject::readBoolEntry( const QString &scope, const QString &key, bool d
|
|||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsProperty QgsProject::readPropertyEntry( const QString &scope, const QString &key, QgsProperty def, bool *ok ) const
|
QgsProperty QgsProject::readPropertyEntry( const QString &scope, const QString &key, const QgsProperty &def, bool *ok ) const
|
||||||
{
|
{
|
||||||
QgsProjectProperty *property = findKey_( scope, key, mProperties );
|
QgsProjectProperty *property = findKey_( scope, key, mProperties );
|
||||||
|
|
||||||
if ( property )
|
if ( property )
|
||||||
{
|
{
|
||||||
QgsProperty qgsproperty;
|
QgsProperty propertyValue;
|
||||||
QVariant value = property->value();
|
QVariant value = property->value();
|
||||||
bool loaded = qgsproperty.loadVariant( value );
|
bool loaded = propertyValue.loadVariant( value );
|
||||||
if ( ok )
|
if ( ok )
|
||||||
*ok = loaded;
|
*ok = loaded;
|
||||||
|
|
||||||
if ( loaded )
|
if ( loaded )
|
||||||
return qgsproperty;
|
return propertyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
|
@ -445,7 +445,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
|
|||||||
int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok = nullptr ) const;
|
int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok = nullptr ) const;
|
||||||
double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok = nullptr ) const;
|
double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok = nullptr ) const;
|
||||||
bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok = nullptr ) const;
|
bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok = nullptr ) const;
|
||||||
QgsProperty readPropertyEntry( const QString &scope, const QString &key, QgsProperty def = QgsProperty(), bool *ok = nullptr ) const;
|
QgsProperty readPropertyEntry( const QString &scope, const QString &key, const QgsProperty &def = QgsProperty(), bool *ok = nullptr ) const;
|
||||||
|
|
||||||
|
|
||||||
//! Remove the given key
|
//! Remove the given key
|
||||||
|
@ -88,7 +88,6 @@ bool QgsProjectPropertyValue::readXml( const QDomNode &keyNode )
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
case QVariant::Map:
|
case QVariant::Map:
|
||||||
//it's a property
|
|
||||||
mValue = QgsXmlUtils::readVariant( subkeyElement.firstChild().toElement() ).toMap();
|
mValue = QgsXmlUtils::readVariant( subkeyElement.firstChild().toElement() ).toMap();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user