Skip to content

Commit d0d681c

Browse files
committed
[composer] Fix QgsComposerTextTable always blank
1 parent b9bd4d2 commit d0d681c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/core/composer/qgscomposertexttable.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,23 @@ bool QgsComposerTextTable::readXML( const QDomElement& itemElem, const QDomDocum
4242
return tableReadXML( itemElem, doc );
4343
}
4444

45-
bool QgsComposerTextTable::getFeatureAttributes( QList<QgsAttributes>& attributes )
45+
bool QgsComposerTextTable::getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps )
4646
{
47-
attributes.clear();
47+
attributeMaps.clear();
4848

4949
QList< QStringList >::const_iterator rowIt = mRowText.constBegin();
5050
QStringList currentStringList;
5151
for ( ; rowIt != mRowText.constEnd(); ++rowIt )
5252
{
5353
currentStringList = *rowIt;
54-
QVector<QVariant> vec;
54+
55+
attributeMaps.push_back( QgsAttributeMap() );
5556
for ( int i = 0; i < currentStringList.size(); ++i )
5657
{
57-
vec.append( QVariant( currentStringList.at( i ) ) );
58+
attributeMaps.last().insert( i, QVariant( currentStringList.at( i ) ) );
5859
}
59-
attributes.append( vec );
6060
}
61+
6162
return true;
6263
}
6364

src/core/composer/qgscomposertexttable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
3838

3939
protected:
4040
//! @note not available in python bindings
41-
bool getFeatureAttributes( QList<QgsAttributes>& attributes );
41+
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
42+
4243
QMap<int, QString> getHeaderLabels() const;
4344

4445
private:

0 commit comments

Comments
 (0)