mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Rename method which causes spell check issues
This commit is contained in:
parent
5f04a2af2c
commit
f3ac8bc2eb
@ -51,7 +51,7 @@ class QgsAbstractPropertyCollection
|
|||||||
|
|
||||||
virtual bool hasActiveProperties() const = 0;
|
virtual bool hasActiveProperties() const = 0;
|
||||||
|
|
||||||
virtual bool hasActiveDynamicProperties() const = 0;
|
virtual bool hasDynamicProperties() const = 0;
|
||||||
|
|
||||||
virtual bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const = 0;
|
virtual bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const = 0;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class QgsPropertyCollection : QgsAbstractPropertyCollection
|
|||||||
QSet< QString > referencedFields( const QgsExpressionContext& context = QgsExpressionContext() ) const;
|
QSet< QString > referencedFields( const QgsExpressionContext& context = QgsExpressionContext() ) const;
|
||||||
bool isActive( int key ) const;
|
bool isActive( int key ) const;
|
||||||
bool hasActiveProperties() const;
|
bool hasActiveProperties() const;
|
||||||
bool hasActiveDynamicProperties() const;
|
bool hasDynamicProperties() const;
|
||||||
bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const;
|
bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const;
|
||||||
bool readXml( const QDomElement& collectionElem, const QDomDocument& doc, const QgsPropertiesDefinition& definitions );
|
bool readXml( const QDomElement& collectionElem, const QDomDocument& doc, const QgsPropertiesDefinition& definitions );
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class QgsPropertyCollectionStack : QgsAbstractPropertyCollection
|
|||||||
|
|
||||||
bool hasActiveProperties() const;
|
bool hasActiveProperties() const;
|
||||||
|
|
||||||
bool hasActiveDynamicProperties() const;
|
bool hasDynamicProperties() const;
|
||||||
|
|
||||||
bool isActive( int key ) const;
|
bool isActive( int key ) const;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ QgsPropertyCollection::QgsPropertyCollection( const QString& name )
|
|||||||
: QgsAbstractPropertyCollection( name )
|
: QgsAbstractPropertyCollection( name )
|
||||||
, mDirty( false )
|
, mDirty( false )
|
||||||
, mHasActiveProperties( false )
|
, mHasActiveProperties( false )
|
||||||
, mHasActiveDynamicProperties( false )
|
, mHasDynamicProperties( false )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
int QgsPropertyCollection::count() const
|
int QgsPropertyCollection::count() const
|
||||||
@ -122,7 +122,7 @@ void QgsPropertyCollection::clear()
|
|||||||
mProperties.clear();
|
mProperties.clear();
|
||||||
mDirty = false;
|
mDirty = false;
|
||||||
mHasActiveProperties = false;
|
mHasActiveProperties = false;
|
||||||
mHasActiveDynamicProperties = false;
|
mHasDynamicProperties = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsPropertyCollection::setProperty( int key, const QgsProperty& property )
|
void QgsPropertyCollection::setProperty( int key, const QgsProperty& property )
|
||||||
@ -214,7 +214,7 @@ bool QgsPropertyCollection::isActive( int key ) const
|
|||||||
void QgsPropertyCollection::rescan() const
|
void QgsPropertyCollection::rescan() const
|
||||||
{
|
{
|
||||||
mHasActiveProperties = false;
|
mHasActiveProperties = false;
|
||||||
mHasActiveDynamicProperties = false;
|
mHasDynamicProperties = false;
|
||||||
mCount = 0;
|
mCount = 0;
|
||||||
if ( !mProperties.isEmpty() )
|
if ( !mProperties.isEmpty() )
|
||||||
{
|
{
|
||||||
@ -226,7 +226,7 @@ void QgsPropertyCollection::rescan() const
|
|||||||
mHasActiveProperties = true;
|
mHasActiveProperties = true;
|
||||||
if ( it.value().propertyType() != QgsProperty::StaticProperty )
|
if ( it.value().propertyType() != QgsProperty::StaticProperty )
|
||||||
{
|
{
|
||||||
mHasActiveDynamicProperties = true;
|
mHasDynamicProperties = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -245,12 +245,12 @@ bool QgsPropertyCollection::hasActiveProperties() const
|
|||||||
return mHasActiveProperties;
|
return mHasActiveProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPropertyCollection::hasActiveDynamicProperties() const
|
bool QgsPropertyCollection::hasDynamicProperties() const
|
||||||
{
|
{
|
||||||
if ( mDirty )
|
if ( mDirty )
|
||||||
rescan();
|
rescan();
|
||||||
|
|
||||||
return mHasActiveDynamicProperties;
|
return mHasDynamicProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPropertyCollection::writeXml( QDomElement &collectionElem, QDomDocument &doc, const QgsPropertiesDefinition& definitions ) const
|
bool QgsPropertyCollection::writeXml( QDomElement &collectionElem, QDomDocument &doc, const QgsPropertiesDefinition& definitions ) const
|
||||||
@ -309,10 +309,10 @@ bool QgsPropertyCollection::readXml( const QDomElement &collectionElem, const QD
|
|||||||
|
|
||||||
mCount++;
|
mCount++;
|
||||||
mHasActiveProperties = mHasActiveProperties || prop.isActive();
|
mHasActiveProperties = mHasActiveProperties || prop.isActive();
|
||||||
mHasActiveDynamicProperties = mHasActiveDynamicProperties ||
|
mHasDynamicProperties = mHasDynamicProperties ||
|
||||||
( prop.isActive() &&
|
( prop.isActive() &&
|
||||||
( prop.propertyType() == QgsProperty::FieldBasedProperty ||
|
( prop.propertyType() == QgsProperty::FieldBasedProperty ||
|
||||||
prop.propertyType() == QgsProperty::ExpressionBasedProperty ) );
|
prop.propertyType() == QgsProperty::ExpressionBasedProperty ) );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ bool QgsPropertyCollection::readXml( const QDomElement &collectionElem, const QD
|
|||||||
QgsPropertyCollectionStack::QgsPropertyCollectionStack()
|
QgsPropertyCollectionStack::QgsPropertyCollectionStack()
|
||||||
: mDirty( false )
|
: mDirty( false )
|
||||||
, mHasActiveProperties( false )
|
, mHasActiveProperties( false )
|
||||||
, mHasActiveDynamicProperties( false )
|
, mhasDynamicProperties( false )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ QgsPropertyCollectionStack::QgsPropertyCollectionStack( const QgsPropertyCollect
|
|||||||
: QgsAbstractPropertyCollection( other )
|
: QgsAbstractPropertyCollection( other )
|
||||||
, mDirty( false )
|
, mDirty( false )
|
||||||
, mHasActiveProperties( false )
|
, mHasActiveProperties( false )
|
||||||
, mHasActiveDynamicProperties( false )
|
, mhasDynamicProperties( false )
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ QgsPropertyCollectionStack::QgsPropertyCollectionStack( const QgsPropertyCollect
|
|||||||
{
|
{
|
||||||
mStack << new QgsPropertyCollection( *collection );
|
mStack << new QgsPropertyCollection( *collection );
|
||||||
mHasActiveProperties |= collection->hasActiveProperties();
|
mHasActiveProperties |= collection->hasActiveProperties();
|
||||||
mHasActiveDynamicProperties |= collection->hasActiveDynamicProperties();
|
mhasDynamicProperties |= collection->hasDynamicProperties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ QgsPropertyCollectionStack &QgsPropertyCollectionStack::operator=( const QgsProp
|
|||||||
{
|
{
|
||||||
mStack << new QgsPropertyCollection( *collection );
|
mStack << new QgsPropertyCollection( *collection );
|
||||||
mHasActiveProperties |= collection->hasActiveProperties();
|
mHasActiveProperties |= collection->hasActiveProperties();
|
||||||
mHasActiveDynamicProperties |= collection->hasActiveDynamicProperties();
|
mhasDynamicProperties |= collection->hasDynamicProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@ -375,7 +375,7 @@ void QgsPropertyCollectionStack::clear()
|
|||||||
qDeleteAll( mStack );
|
qDeleteAll( mStack );
|
||||||
mStack.clear();
|
mStack.clear();
|
||||||
mHasActiveProperties = false;
|
mHasActiveProperties = false;
|
||||||
mHasActiveDynamicProperties = false;
|
mhasDynamicProperties = false;
|
||||||
mDirty = false;
|
mDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,12 +415,12 @@ bool QgsPropertyCollectionStack::hasActiveProperties() const
|
|||||||
return mHasActiveProperties;
|
return mHasActiveProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPropertyCollectionStack::hasActiveDynamicProperties() const
|
bool QgsPropertyCollectionStack::hasDynamicProperties() const
|
||||||
{
|
{
|
||||||
if ( mDirty )
|
if ( mDirty )
|
||||||
rescan();
|
rescan();
|
||||||
|
|
||||||
return mHasActiveDynamicProperties;
|
return mhasDynamicProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QgsPropertyCollectionStack::isActive( int key ) const
|
bool QgsPropertyCollectionStack::isActive( int key ) const
|
||||||
@ -531,12 +531,12 @@ bool QgsPropertyCollectionStack::readXml( const QDomElement& collectionElem, con
|
|||||||
void QgsPropertyCollectionStack::rescan() const
|
void QgsPropertyCollectionStack::rescan() const
|
||||||
{
|
{
|
||||||
mHasActiveProperties = false;
|
mHasActiveProperties = false;
|
||||||
mHasActiveDynamicProperties = false;
|
mhasDynamicProperties = false;
|
||||||
Q_FOREACH ( const QgsPropertyCollection* collection, mStack )
|
Q_FOREACH ( const QgsPropertyCollection* collection, mStack )
|
||||||
{
|
{
|
||||||
mHasActiveProperties |= collection->hasActiveProperties();
|
mHasActiveProperties |= collection->hasActiveProperties();
|
||||||
mHasActiveDynamicProperties |= collection->hasActiveDynamicProperties();
|
mhasDynamicProperties |= collection->hasDynamicProperties();
|
||||||
if ( mHasActiveProperties && mHasActiveDynamicProperties )
|
if ( mHasActiveProperties && mhasDynamicProperties )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mDirty = false;
|
mDirty = false;
|
||||||
|
@ -205,7 +205,7 @@ class CORE_EXPORT QgsAbstractPropertyCollection
|
|||||||
/**
|
/**
|
||||||
* Returns true if the collection has any active properties, or false if all properties
|
* Returns true if the collection has any active properties, or false if all properties
|
||||||
* within the collection are deactivated.
|
* within the collection are deactivated.
|
||||||
* @see hasActiveDynamicProperties()
|
* @see hasDynamicProperties()
|
||||||
*/
|
*/
|
||||||
virtual bool hasActiveProperties() const = 0;
|
virtual bool hasActiveProperties() const = 0;
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ class CORE_EXPORT QgsAbstractPropertyCollection
|
|||||||
* within the collection are deactivated or if the collection only contains static properties.
|
* within the collection are deactivated or if the collection only contains static properties.
|
||||||
* @see hasActiveProperties()
|
* @see hasActiveProperties()
|
||||||
*/
|
*/
|
||||||
virtual bool hasActiveDynamicProperties() const = 0;
|
virtual bool hasDynamicProperties() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the current state of the property collection into an XML element
|
* Writes the current state of the property collection into an XML element
|
||||||
@ -284,7 +284,7 @@ class CORE_EXPORT QgsPropertyCollection : public QgsAbstractPropertyCollection
|
|||||||
QSet< QString > referencedFields( const QgsExpressionContext& context = QgsExpressionContext() ) const override;
|
QSet< QString > referencedFields( const QgsExpressionContext& context = QgsExpressionContext() ) const override;
|
||||||
bool isActive( int key ) const override;
|
bool isActive( int key ) const override;
|
||||||
bool hasActiveProperties() const override;
|
bool hasActiveProperties() const override;
|
||||||
bool hasActiveDynamicProperties() const override;
|
bool hasDynamicProperties() const override;
|
||||||
bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const override;
|
bool writeXml( QDomElement& collectionElem, QDomDocument& doc, const QgsPropertiesDefinition& definitions ) const override;
|
||||||
bool readXml( const QDomElement& collectionElem, const QDomDocument& doc, const QgsPropertiesDefinition& definitions ) override;
|
bool readXml( const QDomElement& collectionElem, const QDomDocument& doc, const QgsPropertiesDefinition& definitions ) override;
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ class CORE_EXPORT QgsPropertyCollection : public QgsAbstractPropertyCollection
|
|||||||
|
|
||||||
mutable bool mDirty;
|
mutable bool mDirty;
|
||||||
mutable bool mHasActiveProperties;
|
mutable bool mHasActiveProperties;
|
||||||
mutable bool mHasActiveDynamicProperties;
|
mutable bool mHasDynamicProperties;
|
||||||
mutable int mCount = 0;
|
mutable int mCount = 0;
|
||||||
|
|
||||||
//! Scans through properties and updates cached values
|
//! Scans through properties and updates cached values
|
||||||
@ -384,7 +384,7 @@ class CORE_EXPORT QgsPropertyCollectionStack : public QgsAbstractPropertyCollect
|
|||||||
* Returns true if the collection has any active properties, or false if all properties
|
* Returns true if the collection has any active properties, or false if all properties
|
||||||
* within the collection are deactivated.
|
* within the collection are deactivated.
|
||||||
* @see isActive()
|
* @see isActive()
|
||||||
* @see hasActiveDynamicProperties()
|
* @see hasDynamicProperties()
|
||||||
*/
|
*/
|
||||||
bool hasActiveProperties() const override;
|
bool hasActiveProperties() const override;
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ class CORE_EXPORT QgsPropertyCollectionStack : public QgsAbstractPropertyCollect
|
|||||||
* within the collection are deactivated or if the collection only contains static properties.
|
* within the collection are deactivated or if the collection only contains static properties.
|
||||||
* @see hasActiveProperties()
|
* @see hasActiveProperties()
|
||||||
*/
|
*/
|
||||||
bool hasActiveDynamicProperties() const override;
|
bool hasDynamicProperties() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the stack contains an active property with the specified key.
|
* Returns true if the stack contains an active property with the specified key.
|
||||||
@ -441,7 +441,7 @@ class CORE_EXPORT QgsPropertyCollectionStack : public QgsAbstractPropertyCollect
|
|||||||
|
|
||||||
mutable bool mDirty;
|
mutable bool mDirty;
|
||||||
mutable bool mHasActiveProperties;
|
mutable bool mHasActiveProperties;
|
||||||
mutable bool mHasActiveDynamicProperties;
|
mutable bool mhasDynamicProperties;
|
||||||
|
|
||||||
//! Scans through properties and updates cached values
|
//! Scans through properties and updates cached values
|
||||||
void rescan() const;
|
void rescan() const;
|
||||||
|
@ -832,7 +832,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QVERIFY( collection.referencedFields( context ).isEmpty() );
|
QVERIFY( collection.referencedFields( context ).isEmpty() );
|
||||||
QCOMPARE( collection.count(), 0 );
|
QCOMPARE( collection.count(), 0 );
|
||||||
QCOMPARE( collection.propertyKeys(), QSet< int >() );
|
QCOMPARE( collection.propertyKeys(), QSet< int >() );
|
||||||
QVERIFY( !collection.hasActiveDynamicProperties() );
|
QVERIFY( !collection.hasDynamicProperties() );
|
||||||
QVERIFY( !collection.hasActiveProperties() );
|
QVERIFY( !collection.hasActiveProperties() );
|
||||||
|
|
||||||
QgsProperty property = QgsProperty::fromValue( "value", true );
|
QgsProperty property = QgsProperty::fromValue( "value", true );
|
||||||
@ -844,7 +844,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QCOMPARE( collection.value( Property1, context ), property.value( context ) );
|
QCOMPARE( collection.value( Property1, context ), property.value( context ) );
|
||||||
QVERIFY( collection.isActive( Property1 ) );
|
QVERIFY( collection.isActive( Property1 ) );
|
||||||
QVERIFY( collection.hasActiveProperties() );
|
QVERIFY( collection.hasActiveProperties() );
|
||||||
QVERIFY( !collection.hasActiveDynamicProperties() );
|
QVERIFY( !collection.hasDynamicProperties() );
|
||||||
|
|
||||||
//preparation
|
//preparation
|
||||||
QVERIFY( collection.prepare( context ) );
|
QVERIFY( collection.prepare( context ) );
|
||||||
@ -862,7 +862,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QCOMPARE( collection.propertyKeys(), QSet< int >() << Property1 );
|
QCOMPARE( collection.propertyKeys(), QSet< int >() << Property1 );
|
||||||
QCOMPARE( collection.property( Property1 ).value( context ), property2.value( context ) );
|
QCOMPARE( collection.property( Property1 ).value( context ), property2.value( context ) );
|
||||||
QVERIFY( collection.hasActiveProperties() );
|
QVERIFY( collection.hasActiveProperties() );
|
||||||
QVERIFY( !collection.hasActiveDynamicProperties() );
|
QVERIFY( !collection.hasDynamicProperties() );
|
||||||
|
|
||||||
//implicit conversion
|
//implicit conversion
|
||||||
collection.setProperty( Property3, 5 );
|
collection.setProperty( Property3, 5 );
|
||||||
@ -884,7 +884,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QCOMPARE( collection.count(), 0 );
|
QCOMPARE( collection.count(), 0 );
|
||||||
QCOMPARE( collection.propertyKeys(), QSet<int>() );
|
QCOMPARE( collection.propertyKeys(), QSet<int>() );
|
||||||
QVERIFY( !collection.hasActiveProperties() );
|
QVERIFY( !collection.hasActiveProperties() );
|
||||||
QVERIFY( !collection.hasActiveDynamicProperties() );
|
QVERIFY( !collection.hasDynamicProperties() );
|
||||||
|
|
||||||
collection.setProperty( Property1, QgsProperty::fromValue( "v1", true ) );
|
collection.setProperty( Property1, QgsProperty::fromValue( "v1", true ) );
|
||||||
collection.setProperty( Property2, QgsProperty::fromValue( "v2", false ) );
|
collection.setProperty( Property2, QgsProperty::fromValue( "v2", false ) );
|
||||||
@ -923,7 +923,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QVERIFY( restoredCollection.property( Property4 ).isActive() );
|
QVERIFY( restoredCollection.property( Property4 ).isActive() );
|
||||||
QCOMPARE( restoredCollection.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
QCOMPARE( restoredCollection.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
||||||
QVERIFY( restoredCollection.hasActiveProperties() );
|
QVERIFY( restoredCollection.hasActiveProperties() );
|
||||||
QVERIFY( restoredCollection.hasActiveDynamicProperties() );
|
QVERIFY( restoredCollection.hasDynamicProperties() );
|
||||||
|
|
||||||
// copy constructor
|
// copy constructor
|
||||||
QgsPropertyCollection collection2( collection );
|
QgsPropertyCollection collection2( collection );
|
||||||
@ -942,7 +942,7 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QVERIFY( collection2.property( Property4 ).isActive() );
|
QVERIFY( collection2.property( Property4 ).isActive() );
|
||||||
QCOMPARE( collection2.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
QCOMPARE( collection2.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
||||||
QVERIFY( collection2.hasActiveProperties() );
|
QVERIFY( collection2.hasActiveProperties() );
|
||||||
QVERIFY( collection2.hasActiveDynamicProperties() );
|
QVERIFY( collection2.hasDynamicProperties() );
|
||||||
|
|
||||||
// assignment operator
|
// assignment operator
|
||||||
QgsPropertyCollection collection3;
|
QgsPropertyCollection collection3;
|
||||||
@ -963,21 +963,21 @@ void TestQgsProperty::propertyCollection()
|
|||||||
QVERIFY( collection3.property( Property4 ).isActive() );
|
QVERIFY( collection3.property( Property4 ).isActive() );
|
||||||
QCOMPARE( collection3.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
QCOMPARE( collection3.property( Property4 ).expressionString(), QString( "\"field1\" + \"field2\"" ) );
|
||||||
QVERIFY( collection3.hasActiveProperties() );
|
QVERIFY( collection3.hasActiveProperties() );
|
||||||
QVERIFY( collection3.hasActiveDynamicProperties() );
|
QVERIFY( collection3.hasDynamicProperties() );
|
||||||
|
|
||||||
//test hasActiveProperties() and hasActiveDynamicProperties()
|
//test hasActiveProperties() and hasDynamicProperties()
|
||||||
collection3.property( Property1 ).setActive( false );
|
collection3.property( Property1 ).setActive( false );
|
||||||
collection3.property( Property2 ).setActive( false );
|
collection3.property( Property2 ).setActive( false );
|
||||||
collection3.property( Property3 ).setActive( false );
|
collection3.property( Property3 ).setActive( false );
|
||||||
collection3.property( Property4 ).setActive( false );
|
collection3.property( Property4 ).setActive( false );
|
||||||
QVERIFY( !collection3.hasActiveProperties() );
|
QVERIFY( !collection3.hasActiveProperties() );
|
||||||
QVERIFY( !collection3.hasActiveDynamicProperties() );
|
QVERIFY( !collection3.hasDynamicProperties() );
|
||||||
collection3.property( Property4 ).setActive( true );
|
collection3.property( Property4 ).setActive( true );
|
||||||
QVERIFY( collection3.hasActiveDynamicProperties() );
|
QVERIFY( collection3.hasDynamicProperties() );
|
||||||
QVERIFY( collection3.hasActiveProperties() );
|
QVERIFY( collection3.hasActiveProperties() );
|
||||||
collection3.property( Property4 ).setActive( false );
|
collection3.property( Property4 ).setActive( false );
|
||||||
collection3.property( Property2 ).setActive( true );
|
collection3.property( Property2 ).setActive( true );
|
||||||
QVERIFY( !collection3.hasActiveDynamicProperties() );
|
QVERIFY( !collection3.hasDynamicProperties() );
|
||||||
QVERIFY( collection3.hasActiveProperties() );
|
QVERIFY( collection3.hasActiveProperties() );
|
||||||
collection3.property( Property2 ).setActive( false );
|
collection3.property( Property2 ).setActive( false );
|
||||||
QVERIFY( !collection3.hasActiveProperties() );
|
QVERIFY( !collection3.hasActiveProperties() );
|
||||||
@ -1020,7 +1020,7 @@ void TestQgsProperty::collectionStack()
|
|||||||
QVERIFY( !stack.isActive( Property1 ) );
|
QVERIFY( !stack.isActive( Property1 ) );
|
||||||
QVERIFY( stack.referencedFields( context ).isEmpty() );
|
QVERIFY( stack.referencedFields( context ).isEmpty() );
|
||||||
QCOMPARE( stack.count(), 0 );
|
QCOMPARE( stack.count(), 0 );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( !stack.hasActiveProperties() );
|
QVERIFY( !stack.hasActiveProperties() );
|
||||||
|
|
||||||
//add a collection to the stack
|
//add a collection to the stack
|
||||||
@ -1035,7 +1035,7 @@ void TestQgsProperty::collectionStack()
|
|||||||
QVERIFY( !stack.value( Property1, context ).isValid() );
|
QVERIFY( !stack.value( Property1, context ).isValid() );
|
||||||
QCOMPARE( stack.value( Property1, context, "default" ).toString(), QString( "default" ) );
|
QCOMPARE( stack.value( Property1, context, "default" ).toString(), QString( "default" ) );
|
||||||
QVERIFY( !stack.isActive( Property1 ) );
|
QVERIFY( !stack.isActive( Property1 ) );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( !stack.hasActiveProperties() );
|
QVERIFY( !stack.hasActiveProperties() );
|
||||||
QVERIFY( stack.referencedFields( context ).isEmpty() );
|
QVERIFY( stack.referencedFields( context ).isEmpty() );
|
||||||
|
|
||||||
@ -1045,12 +1045,12 @@ void TestQgsProperty::collectionStack()
|
|||||||
QVERIFY( stack.isActive( Property1 ) );
|
QVERIFY( stack.isActive( Property1 ) );
|
||||||
QCOMPARE( stack.property( Property1 ).value( context ), property.value( context ) );
|
QCOMPARE( stack.property( Property1 ).value( context ), property.value( context ) );
|
||||||
QCOMPARE( stack.value( Property1, context ), property.value( context ) );
|
QCOMPARE( stack.value( Property1, context ), property.value( context ) );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( stack.hasActiveProperties() );
|
QVERIFY( stack.hasActiveProperties() );
|
||||||
QVERIFY( !stack.isActive( Property2 ) );
|
QVERIFY( !stack.isActive( Property2 ) );
|
||||||
collection->setProperty( Property2, QgsProperty::fromValue( "value1", true ) );
|
collection->setProperty( Property2, QgsProperty::fromValue( "value1", true ) );
|
||||||
QVERIFY( stack.isActive( Property2 ) );
|
QVERIFY( stack.isActive( Property2 ) );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( stack.hasActiveProperties() );
|
QVERIFY( stack.hasActiveProperties() );
|
||||||
|
|
||||||
//add a second collection
|
//add a second collection
|
||||||
@ -1060,14 +1060,14 @@ void TestQgsProperty::collectionStack()
|
|||||||
QCOMPARE( stack.at( 1 ), collection2 );
|
QCOMPARE( stack.at( 1 ), collection2 );
|
||||||
QCOMPARE( const_cast< const QgsPropertyCollectionStack* >( &stack )->at( 1 ), collection2 );
|
QCOMPARE( const_cast< const QgsPropertyCollectionStack* >( &stack )->at( 1 ), collection2 );
|
||||||
QCOMPARE( stack.collection( "collection2" ), collection2 );
|
QCOMPARE( stack.collection( "collection2" ), collection2 );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( stack.hasActiveProperties() );
|
QVERIFY( stack.hasActiveProperties() );
|
||||||
QgsProperty property2 = QgsProperty::fromValue( "value2", true );
|
QgsProperty property2 = QgsProperty::fromValue( "value2", true );
|
||||||
collection2->setProperty( Property2, property2 );
|
collection2->setProperty( Property2, property2 );
|
||||||
QVERIFY( stack.isActive( Property2 ) );
|
QVERIFY( stack.isActive( Property2 ) );
|
||||||
QCOMPARE( stack.property( Property2 ).value( context ), property2.value( context ) );
|
QCOMPARE( stack.property( Property2 ).value( context ), property2.value( context ) );
|
||||||
QCOMPARE( stack.value( Property2, context ), property2.value( context ) );
|
QCOMPARE( stack.value( Property2, context ), property2.value( context ) );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( stack.hasActiveProperties() );
|
QVERIFY( stack.hasActiveProperties() );
|
||||||
|
|
||||||
//preparation
|
//preparation
|
||||||
@ -1095,7 +1095,7 @@ void TestQgsProperty::collectionStack()
|
|||||||
//clearing
|
//clearing
|
||||||
stack.clear();
|
stack.clear();
|
||||||
QCOMPARE( stack.count(), 0 );
|
QCOMPARE( stack.count(), 0 );
|
||||||
QVERIFY( !stack.hasActiveDynamicProperties() );
|
QVERIFY( !stack.hasDynamicProperties() );
|
||||||
QVERIFY( !stack.hasActiveProperties() );
|
QVERIFY( !stack.hasActiveProperties() );
|
||||||
|
|
||||||
// test copying a stack
|
// test copying a stack
|
||||||
@ -1113,7 +1113,7 @@ void TestQgsProperty::collectionStack()
|
|||||||
QCOMPARE( stack3.at( 0 )->property( Property1 ).staticValue(), QVariant( "val1" ) );
|
QCOMPARE( stack3.at( 0 )->property( Property1 ).staticValue(), QVariant( "val1" ) );
|
||||||
QCOMPARE( stack3.at( 0 )->property( Property2 ).staticValue(), QVariant( "val2" ) );
|
QCOMPARE( stack3.at( 0 )->property( Property2 ).staticValue(), QVariant( "val2" ) );
|
||||||
QCOMPARE( stack3.at( 1 )->property( Property3 ).staticValue(), QVariant( "val3" ) );
|
QCOMPARE( stack3.at( 1 )->property( Property3 ).staticValue(), QVariant( "val3" ) );
|
||||||
QVERIFY( !stack3.hasActiveDynamicProperties() );
|
QVERIFY( !stack3.hasDynamicProperties() );
|
||||||
QVERIFY( stack3.hasActiveProperties() );
|
QVERIFY( stack3.hasActiveProperties() );
|
||||||
//assignment operator
|
//assignment operator
|
||||||
stack3.clear();
|
stack3.clear();
|
||||||
@ -1125,14 +1125,14 @@ void TestQgsProperty::collectionStack()
|
|||||||
QCOMPARE( stack3.at( 0 )->property( Property1 ).staticValue(), QVariant( "val1" ) );
|
QCOMPARE( stack3.at( 0 )->property( Property1 ).staticValue(), QVariant( "val1" ) );
|
||||||
QCOMPARE( stack3.at( 0 )->property( Property2 ).staticValue(), QVariant( "val2" ) );
|
QCOMPARE( stack3.at( 0 )->property( Property2 ).staticValue(), QVariant( "val2" ) );
|
||||||
QCOMPARE( stack3.at( 1 )->property( Property3 ).staticValue(), QVariant( "val3" ) );
|
QCOMPARE( stack3.at( 1 )->property( Property3 ).staticValue(), QVariant( "val3" ) );
|
||||||
QVERIFY( !stack3.hasActiveDynamicProperties() );
|
QVERIFY( !stack3.hasDynamicProperties() );
|
||||||
QVERIFY( stack3.hasActiveProperties() );
|
QVERIFY( stack3.hasActiveProperties() );
|
||||||
|
|
||||||
//check hasActiveDynamicProperties() and hasActiveProperties()
|
//check hasDynamicProperties() and hasActiveProperties()
|
||||||
QgsPropertyCollectionStack stack4;
|
QgsPropertyCollectionStack stack4;
|
||||||
stack4.appendCollection( new QgsPropertyCollection( "collection1" ) );
|
stack4.appendCollection( new QgsPropertyCollection( "collection1" ) );
|
||||||
stack4.at( 0 )->setProperty( Property1, "val1" );
|
stack4.at( 0 )->setProperty( Property1, "val1" );
|
||||||
QVERIFY( !stack4.hasActiveDynamicProperties() );
|
QVERIFY( !stack4.hasDynamicProperties() );
|
||||||
QVERIFY( stack4.hasActiveProperties() );
|
QVERIFY( stack4.hasActiveProperties() );
|
||||||
stack4.at( 0 )->property( Property1 ).setActive( false );
|
stack4.at( 0 )->property( Property1 ).setActive( false );
|
||||||
QVERIFY( !stack4.hasActiveProperties() );
|
QVERIFY( !stack4.hasActiveProperties() );
|
||||||
@ -1140,14 +1140,14 @@ void TestQgsProperty::collectionStack()
|
|||||||
QVERIFY( stack4.hasActiveProperties() );
|
QVERIFY( stack4.hasActiveProperties() );
|
||||||
stack4.at( 0 )->setProperty( Property2, QgsProperty::fromExpression( "\"field1\" + \"field2\"", true ) );
|
stack4.at( 0 )->setProperty( Property2, QgsProperty::fromExpression( "\"field1\" + \"field2\"", true ) );
|
||||||
QVERIFY( stack4.hasActiveProperties() );
|
QVERIFY( stack4.hasActiveProperties() );
|
||||||
QVERIFY( stack4.hasActiveDynamicProperties() );
|
QVERIFY( stack4.hasDynamicProperties() );
|
||||||
QCOMPARE( stack4.referencedFields( context ), QSet< QString>() << "field1" << "field2" );
|
QCOMPARE( stack4.referencedFields( context ), QSet< QString>() << "field1" << "field2" );
|
||||||
stack4.at( 0 )->property( Property1 ).setActive( false );
|
stack4.at( 0 )->property( Property1 ).setActive( false );
|
||||||
QVERIFY( stack4.hasActiveProperties() );
|
QVERIFY( stack4.hasActiveProperties() );
|
||||||
QVERIFY( stack4.hasActiveDynamicProperties() );
|
QVERIFY( stack4.hasDynamicProperties() );
|
||||||
stack4.at( 0 )->property( Property2 ).setActive( false );
|
stack4.at( 0 )->property( Property2 ).setActive( false );
|
||||||
QVERIFY( !stack4.hasActiveProperties() );
|
QVERIFY( !stack4.hasActiveProperties() );
|
||||||
QVERIFY( !stack4.hasActiveDynamicProperties() );
|
QVERIFY( !stack4.hasDynamicProperties() );
|
||||||
}
|
}
|
||||||
|
|
||||||
QGSTEST_MAIN( TestQgsProperty )
|
QGSTEST_MAIN( TestQgsProperty )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user