Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sync some sip bindings
  • Loading branch information
jef-n committed May 18, 2014
1 parent b66ee23 commit bbdf7cd
Show file tree
Hide file tree
Showing 20 changed files with 275 additions and 179 deletions.
62 changes: 42 additions & 20 deletions python/core/composer/qgscomposerattributetable.sip
Expand Up @@ -12,7 +12,7 @@ class QgsComposerAttributeTableCompare
public:
QgsComposerAttributeTableCompare();
// bool operator()( const QgsAttributeMap& m1, const QgsAttributeMap& m2 );

/**Sets column number to sort by
* @param col column number for sorting
*/
Expand Down Expand Up @@ -47,7 +47,7 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see readXML
*/
bool writeXML( QDomElement& elem, QDomDocument & doc ) const;

/**Reads the properties specific to an attribute table from xml.
* @param itemElem a QDomElement holding the attribute table's desired properties.
* @param doc QDomDocument for the source xml.
Expand All @@ -60,13 +60,13 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see vectorLayer
*/
void setVectorLayer( QgsVectorLayer* layer );

/**Returns the vector layer the attribute table is currently using
* @returns attribute table's current vector layer
* @see setVectorLayer
*/
QgsVectorLayer* vectorLayer() const;

/**Resets the attribute table's columns to match the vector layer's fields
* @note added in 2.3
* @see setVectorLayer
Expand All @@ -83,13 +83,13 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see setDisplayOnlyVisibleFeatures
*/
void setComposerMap( const QgsComposerMap* map /TransferThis/ );

/**Returns the composer map whose extents are controlling the features shown in the
* table. The extents of the map are only used if displayOnlyVisibleFeatures() is true.
* @returns composer map controlling the attribute table
* @see setComposerMap
* @see displayOnlyVisibleFeatures
*/
*/
const QgsComposerMap* composerMap() const;

/**Sets the maximum number of features shown by the table. Changing this setting may result
Expand All @@ -99,11 +99,11 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see maximumNumberOfFeatures
*/
void setMaximumNumberOfFeatures( int features );

/**Returns the maximum number of features to be shown by the table.
* @returns maximum number of features
* @see setMaximumNumberOfFeatures
*/
*/
int maximumNumberOfFeatures() const;

/**Sets attribute table to only show features which are visible in a composer map item. Changing
Expand All @@ -114,23 +114,23 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see setComposerMap
*/
void setDisplayOnlyVisibleFeatures( bool b );

/**Returns true if the table is set to show only features visible on a corresponding
* composer map item.
* @returns true if table only shows visible features
* @see composerMap
* @see setDisplayOnlyVisibleFeatures
*/
*/
bool displayOnlyVisibleFeatures() const;

/**Returns true if a feature filter is active on the attribute table
* @returns bool state of the feature filter
* @note added in 2.3
* @see setFilterFeatures
* @see featureFilter
*/
bool filterFeatures() const;

/**Sets whether the feature filter is active for the attribute table. Changing
* this setting forces the table to refetch features from its vector layer, and may result in
* the table changing size to accommodate the new displayed feature attributes.
Expand All @@ -149,7 +149,7 @@ class QgsComposerAttributeTable : QgsComposerTable
* @see filterFeatures
*/
QString featureFilter() const;

/**Sets the expression used for filtering features in the table. The filter is only
* active if filterFeatures() is set to true. Changing this setting forces the table
* to refetch features from its vector layer, and may result in
Expand All @@ -168,15 +168,15 @@ class QgsComposerAttributeTable : QgsComposerTable
* @deprecated use QgsComposerTable::columns() instead
*/
QSet<int> displayAttributes() const /Deprecated/;

/**Sets the attributes to display in the table.
* @param attr QSet of integer values refering to the attributes from the vector layer to show.
* Set to an empty QSet to show all feature attributes.
* @param refresh set to true to force the table to refetch features from its vector layer
* and immediately update the display of the table. This may result in the table changing size
* to accommodate the new displayed feature attributes.
* @see displayAttributes
*/
*/
void setDisplayAttributes( const QSet<int>& attr );

/**Returns the attribute field aliases, which control how fields are named in the table's
Expand All @@ -187,14 +187,14 @@ class QgsComposerAttributeTable : QgsComposerTable
* @deprecated use QgsComposerTable::columns() instead
*/
QMap<int, QString> fieldAliasMap() const /Deprecated/;

/**Sets the attribute field aliases, which control how fields are named in the table's
* header row.
* @param map QMap of integers to strings, where the string is the alias to use for the
* corresponding field, and the integer is the field index from the vector layer
* @see fieldAliasMap
* @deprecated use QgsComposerTable::columns() instead
*/
*/
void setFieldAliasMap( const QMap<int, QString>& map ) /Deprecated/;

/**Adapts mMaximumNumberOfFeatures depending on the rectangle height. Calling this forces
Expand All @@ -205,12 +205,34 @@ class QgsComposerAttributeTable : QgsComposerTable
*/
void setSceneRect( const QRectF& rectangle );

// @note not available in python bindings
// void setSortAttributes( const QList<QPair<int, bool> > att );
/**Sets the attributes to use to sort the table's features.
* @param att QList integers/bool pairs, where the integer refers to the attribute index and
* the bool sets the sort order for the attribute. If true the attribute is sorted ascending,
* if false, the attribute is sorted in descending order. Note that features are sorted
* after the maximum number of displayed features have been fetched from the vector layer's
* provider.
* @see sortAttributes
* @deprecated use QgsComposerTable::columns() instead
* @note not available in python bindings
*/
// void setSortAttributes( const QList<QPair<int, bool> > att ) /Deprecated/;

// @note not available in python bindings
/**Returns the attributes used to sort the table's features.
* @returns a QList of integer/bool pairs, where the integer refers to the attribute index and
* the bool to the sort order for the attribute. If true the attribute is sorted ascending,
* if false, the attribute is sorted in descending order.
* @note not available in python bindings
*/
// QList<QPair<int, bool> > sortAttributes() const;

/**Queries the attribute table's vector layer for attributes to show in the table.
* @param attributeMaps list of QgsAttributeMaps where the fetched feature attributes will be stored
* @returns true if attributes were successfully fetched
* @note not available in python bindings
*/
// bool getFeatureAttributes( QList<QgsAttributeMap>& attributeMaps );


signals:
/**This signal is emitted if the maximum number of feature changes (interactively)*/
void maximumNumberOfFeaturesChanged( int n );
Expand Down
13 changes: 8 additions & 5 deletions python/core/composer/qgscomposerattributetablemodel.sip
Expand Up @@ -5,7 +5,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
#include <qgscomposerattributetablemodel.h>
%End

public:
public:

/*! Controls whether a row/column is shifted up or down
*/
Expand All @@ -17,6 +17,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel

/**Constructor for QgsComposerAttributeTableColumnModel.
* @param composerTable QgsComposerAttributeTable the model is attached to
* @param parent optional parent
*/
QgsComposerAttributeTableColumnModel( QgsComposerAttributeTable *composerTable, QObject *parent = 0 );
virtual ~QgsComposerAttributeTableColumnModel();
Expand All @@ -30,6 +31,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
bool insertRows( int row, int count, const QModelIndex &parent = QModelIndex() );
QModelIndex index( int row, int column, const QModelIndex &parent ) const;
QModelIndex parent( const QModelIndex &child ) const;

/**Moves the specified row up or down in the model. Used for rearranging the attribute tables
* columns.
Expand Down Expand Up @@ -87,7 +89,7 @@ class QgsComposerAttributeTableColumnModel: QAbstractTableModel
* @see setColumnAsSorted
*/
bool moveColumnInSortRank( QgsComposerTableColumn * column, ShiftDirection direction );

};

/**Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted*/
Expand All @@ -98,7 +100,8 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
%End

public:
/*! Controls whether the proxy model shows sorted or unsorted columns

/*! Controls whether the proxy model shows sorted or unsorted columns
*/
enum ColumnFilterType
{
Expand All @@ -109,6 +112,7 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
/**Constructor for QgsComposerTableSortColumnsProxyModel.
* @param composerTable QgsComposerAttributeTable the model is attached to
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
* @param parent optional parent
*/
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent = 0 );

Expand Down Expand Up @@ -142,15 +146,14 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
/**Returns the QgsComposerTableColumn corresponding to an index from the source
* QgsComposerAttributeTableColumnModel model.
* @returns QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
* @param index a QModelIndex
* @param sourceIndex a QModelIndex
* @note added in 2.3
* @see columnFromRow
* @see columnFromIndex
*/
QgsComposerTableColumn* columnFromSourceIndex( const QModelIndex& sourceIndex ) const;

protected:

bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const;

};

0 comments on commit bbdf7cd

Please sign in to comment.