QGIS/python/core/composer/qgscomposertexttable.sip

88 lines
3.1 KiB
Plaintext
Raw Normal View History

/** A text table item that reads text from string lists
* @deprecated use QgsComposerTextTableV2 instead
*/
class QgsComposerTextTable: QgsComposerTable
{
%TypeHeaderCode
#include <qgscomposertexttable.h>
%End
public:
QgsComposerTextTable( QgsComposition* c /TransferThis/ ) /Deprecated/;
~QgsComposerTextTable();
2015-07-29 11:52:14 +02:00
/** Return correct graphics item type. */
virtual int type() const;
2014-05-18 15:22:26 +02:00
2015-07-29 11:52:14 +02:00
/** Sets the text to use for the header row for the table
* @param labels list of strings to use for each column's header row
* @see headerLabels
2016-02-14 03:50:23 +01:00
*/
void setHeaderLabels( const QStringList& labels );
2014-05-18 15:22:26 +02:00
2015-07-29 11:52:14 +02:00
/** Adds a row to the table
* @param row list of strings to use for each cell's value in the newly added row
* @note If row is shorter than the number of columns in the table than blank cells
* will be inserted at the end of the row. If row contains more strings then the number
* of columns in the table then these extra strings will be ignored.
2016-02-14 03:50:23 +01:00
*/
void addRow( const QStringList& row );
2015-07-29 11:52:14 +02:00
/** Writes properties specific to text tables
* @param elem an existing QDomElement in which to store the text table's properties.
* @param doc QDomDocument for the destination xml.
* @see readXML
*/
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
2014-05-18 15:22:26 +02:00
2015-07-29 11:52:14 +02:00
/** Reads the properties specific to a text table from xml.
* @param itemElem a QDomElement holding the text table's desired properties.
* @param doc QDomDocument for the source xml.
* @see writeXML
*/
bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
2015-07-29 11:52:14 +02:00
/** Queries the text table for text to show in the cells.
2014-05-18 15:22:26 +02:00
* @param attributeMaps list of QgsAttributeMaps where the cell text will be stored
* @returns true if attribute values were successfully set from table's text
* @note not available in python bindings
*/
// bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );
};
2015-07-29 11:52:14 +02:00
/** A text table item that reads text from string lists
* @note added in QGIS 2.10
*/
class QgsComposerTextTableV2 : QgsComposerTableV2
{
%TypeHeaderCode
#include <qgscomposertexttable.h>
%End
public:
QgsComposerTextTableV2( QgsComposition* c /TransferThis/, bool createUndoCommands );
~QgsComposerTextTableV2();
/** Adds a row to the table
* @param row list of strings to use for each cell's value in the newly added row
* @note If row is shorter than the number of columns in the table than blank cells
2016-02-14 03:50:23 +01:00
* will be inserted at the end of the row. If row contains more strings then the number
* of columns in the table then these extra strings will be ignored.
* @note if adding many rows, @link setContents @endlink is much faster
2016-02-14 03:50:23 +01:00
*/
void addRow( const QStringList& row );
/** Sets the contents of the text table.
* @param contents list of table rows
* @see addRow
*/
void setContents( const QList< QStringList >& contents );
bool getTableContents( QgsComposerTableContents &contents );
virtual void addFrame( QgsComposerFrame* frame, bool recalcFrameSizes = true );
};