Skip to content
Permalink
Browse files

[composer] Fix QgsComposerTextTable always blank

  • Loading branch information
nyalldawson committed Apr 15, 2014
1 parent b9bd4d2 commit d0d681cf5935d1c6b6c2b31704c2bfe73221799d
Showing with 8 additions and 6 deletions.
  1. +6 −5 src/core/composer/qgscomposertexttable.cpp
  2. +2 −1 src/core/composer/qgscomposertexttable.h
@@ -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:

0 comments on commit d0d681c

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