QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsattributes.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributes.cpp - QgsAttributes
3
4 ---------------------
5 begin : 29.3.2017
6 copyright : (C) 2017 by Denis Rouzaud
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#include "qgsattributes.h"
18#include "qgis.h"
19
20
22{
24 for ( int idx = 0; idx < count(); ++idx )
25 {
26 const QVariant v = at( idx );
27 if ( v.isValid() )
28 map.insert( idx, v );
29 }
30 return map;
31}
32
33uint qHash( const QgsAttributes &attributes )
34{
35 if ( attributes.isEmpty() )
36 return std::numeric_limits<uint>::max();
37 else
38 return qHash( attributes.at( 0 ) );
39}
A vector of attributes.
CORE_EXPORT QgsAttributeMap toMap() const
Returns a QgsAttributeMap of the attribute values.
uint qHash(const QgsAttributes &attributes)
Hash for QgsAttributes.
QMap< int, QVariant > QgsAttributeMap