Skip to content

Commit

Permalink
Add missing qHash for older Qt versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 1, 2017
1 parent 8026008 commit 0fcbeb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/qgsattributes.cpp
Expand Up @@ -29,3 +29,11 @@ QgsAttributeMap QgsAttributes::toMap() const
}
return map;
}

uint qHash( const QgsAttributes &attributes )
{
if ( attributes.isEmpty() )
return -1;
else
return qHash( attributes.at( 0 ) );
}
4 changes: 4 additions & 0 deletions src/core/qgsattributes.h
Expand Up @@ -120,6 +120,10 @@ class CORE_EXPORT QgsAttributes : public QVector<QVariant>

inline bool operator!=( const QgsAttributes &v ) const { return !( *this == v ); }
};

//! Hash for QgsAttributes
CORE_EXPORT uint qHash( const QgsAttributes &attributes );

#else
typedef QVector<QVariant> QgsAttributes;

Expand Down

0 comments on commit 0fcbeb7

Please sign in to comment.