mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[composer] Fix QgsComposerTextTable always blank
This commit is contained in:
parent
b9bd4d247e
commit
d0d681cf59
@ -42,22 +42,23 @@ bool QgsComposerTextTable::readXML( const QDomElement& itemElem, const QDomDocum
|
||||
return tableReadXML( itemElem, doc );
|
||||
}
|
||||
|
||||
bool QgsComposerTextTable::getFeatureAttributes( QList<QgsAttributes>& attributes )
|
||||
bool QgsComposerTextTable::getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps )
|
||||
{
|
||||
attributes.clear();
|
||||
attributeMaps.clear();
|
||||
|
||||
QList< QStringList >::const_iterator rowIt = mRowText.constBegin();
|
||||
QStringList currentStringList;
|
||||
for ( ; rowIt != mRowText.constEnd(); ++rowIt )
|
||||
{
|
||||
currentStringList = *rowIt;
|
||||
QVector<QVariant> vec;
|
||||
|
||||
attributeMaps.push_back( QgsAttributeMap() );
|
||||
for ( int i = 0; i < currentStringList.size(); ++i )
|
||||
{
|
||||
vec.append( QVariant( currentStringList.at( i ) ) );
|
||||
attributeMaps.last().insert( i, QVariant( currentStringList.at( i ) ) );
|
||||
}
|
||||
attributes.append( vec );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,8 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
|
||||
|
||||
protected:
|
||||
//! @note not available in python bindings
|
||||
bool getFeatureAttributes( QList<QgsAttributes>& attributes );
|
||||
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
||||
|
||||
QMap<int, QString> getHeaderLabels() const;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user