mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -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 );
|
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();
|
QList< QStringList >::const_iterator rowIt = mRowText.constBegin();
|
||||||
QStringList currentStringList;
|
QStringList currentStringList;
|
||||||
for ( ; rowIt != mRowText.constEnd(); ++rowIt )
|
for ( ; rowIt != mRowText.constEnd(); ++rowIt )
|
||||||
{
|
{
|
||||||
currentStringList = *rowIt;
|
currentStringList = *rowIt;
|
||||||
QVector<QVariant> vec;
|
|
||||||
|
attributeMaps.push_back( QgsAttributeMap() );
|
||||||
for ( int i = 0; i < currentStringList.size(); ++i )
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ class CORE_EXPORT QgsComposerTextTable: public QgsComposerTable
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! @note not available in python bindings
|
//! @note not available in python bindings
|
||||||
bool getFeatureAttributes( QList<QgsAttributes>& attributes );
|
bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
|
||||||
|
|
||||||
QMap<int, QString> getHeaderLabels() const;
|
QMap<int, QString> getHeaderLabels() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user