Skip to content
Permalink
Browse files

const of QgsProperty and some styling

  • Loading branch information
signedav committed May 14, 2020
1 parent 8824d06 commit 7c0d3b582911688729f7dc03bf12bf7b85ee131c
@@ -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;
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;
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 );
@@ -2488,20 +2488,20 @@ bool QgsProject::readBoolEntry( const QString &scope, const QString &key, bool d
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 );

if ( property )
{
QgsProperty qgsproperty;
QgsProperty propertyValue;
QVariant value = property->value();
bool loaded = qgsproperty.loadVariant( value );
bool loaded = propertyValue.loadVariant( value );
if ( ok )
*ok = loaded;

if ( loaded )
return qgsproperty;
return propertyValue;
}

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;
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;
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
@@ -88,7 +88,6 @@ bool QgsProjectPropertyValue::readXml( const QDomNode &keyNode )
return false;

case QVariant::Map:
//it's a property
mValue = QgsXmlUtils::readVariant( subkeyElement.firstChild().toElement() ).toMap();
break;

0 comments on commit 7c0d3b5

Please sign in to comment.
You can’t perform that action at this time.