QGIS/python/core/qgsattributetableconfig.sip

191 lines
4.9 KiB
Plaintext
Raw Normal View History

2017-04-04 08:44:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributetableconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeTableConfig
{
%Docstring
This is a container for configuration of the attribute table.
The configuration is specific for one vector layer.
.. versionadded:: 2.16
%End
2017-04-04 08:44:22 +02:00
%TypeHeaderCode
2017-04-04 08:44:22 +02:00
#include "qgsattributetableconfig.h"
%End
public:
2017-04-04 08:44:22 +02:00
enum Type
{
2017-04-04 08:44:22 +02:00
Field,
Action
};
struct ColumnConfig
{
ColumnConfig();
2017-04-04 08:44:22 +02:00
%Docstring
Constructor for ColumnConfig
%End
2016-06-03 12:42:56 +10:00
QgsAttributeTableConfig::Type type; //!< The type of this column.
QString name; //!< The name of the attribute if this column represents a field
bool hidden; //!< Flag that controls if the column is hidden
int width; //!< Width of column, or -1 for default width
};
2016-05-02 12:44:36 +02:00
enum ActionWidgetStyle
{
2017-04-04 08:44:22 +02:00
ButtonList,
DropDown
2016-05-02 12:44:36 +02:00
};
QgsAttributeTableConfig();
QVector<QgsAttributeTableConfig::ColumnConfig> columns() const;
2017-04-04 08:44:22 +02:00
%Docstring
Get the list with all columns and their configuration.
The list order defines the order of appearance.
:rtype: list of QgsAttributeTableConfig.ColumnConfig
2017-04-04 08:44:22 +02:00
%End
bool isEmpty() const;
2017-04-04 08:44:22 +02:00
%Docstring
Returns true if the configuration is empty, ie it contains no columns.
:rtype: bool
2017-04-04 08:44:22 +02:00
%End
int mapVisibleColumnToIndex( int visibleColumn ) const;
2017-04-04 08:44:22 +02:00
%Docstring
Maps a visible column index to its original column index.
\param visibleColumn index of visible column
:return: corresponding index when hidden columns are considered
:rtype: int
2017-04-04 08:44:22 +02:00
%End
void setColumns( const QVector<QgsAttributeTableConfig::ColumnConfig> &columns );
%Docstring
Set the list of columns visible in the attribute table.
The list order defines the order of appearance.
%End
void update( const QgsFields &fields );
%Docstring
Update the configuration with the given fields.
Any field which is present in the configuration but not present in the
parameter fields will be removed. Any field which is in the parameter
fields but not in the configuration will be appended.
%End
2016-05-02 12:44:36 +02:00
bool actionWidgetVisible() const;
2017-04-04 08:44:22 +02:00
%Docstring
Returns true if the action widget is visible
:rtype: bool
2017-04-04 08:44:22 +02:00
%End
2016-05-02 12:44:36 +02:00
void setActionWidgetVisible( bool visible );
2017-04-04 08:44:22 +02:00
%Docstring
Set if the action widget is visible
%End
2016-05-02 12:44:36 +02:00
ActionWidgetStyle actionWidgetStyle() const;
2017-04-04 08:44:22 +02:00
%Docstring
Get the style of the action widget
:rtype: ActionWidgetStyle
2017-04-04 08:44:22 +02:00
%End
2016-05-02 12:44:36 +02:00
void setActionWidgetStyle( ActionWidgetStyle actionWidgetStyle );
2017-04-04 08:44:22 +02:00
%Docstring
Set the style of the action widget
%End
2016-05-02 12:44:36 +02:00
2017-04-04 08:44:22 +02:00
void writeXml( QDomNode &node ) const;
%Docstring
Serialize to XML on layer save
%End
2017-04-04 08:44:22 +02:00
void readXml( const QDomNode &node );
%Docstring
Deserialize to XML on layer load
%End
QString sortExpression() const;
2017-04-04 08:44:22 +02:00
%Docstring
Get the expression used for sorting.
:rtype: str
2017-04-04 08:44:22 +02:00
%End
2017-04-04 08:44:22 +02:00
void setSortExpression( const QString &sortExpression );
%Docstring
Set the sort expression used for sorting.
%End
int columnWidth( int column ) const;
2017-04-04 08:44:22 +02:00
%Docstring
Returns the width of a column, or -1 if column should use default width.
\param column column index
\see setColumnWidth()
:rtype: int
2017-04-04 08:44:22 +02:00
%End
void setColumnWidth( int column, int width );
2017-04-04 08:44:22 +02:00
%Docstring
Sets the width of a column.
\param column column index
\param width column width in pixels, or -1 if column should use default width
\see columnWidth()
%End
bool columnHidden( int column ) const;
2017-04-04 08:44:22 +02:00
%Docstring
Returns true if the specified column is hidden.
\param column column index
\see setColumnHidden()
:rtype: bool
2017-04-04 08:44:22 +02:00
%End
void setColumnHidden( int column, bool hidden );
2017-04-04 08:44:22 +02:00
%Docstring
Sets whether the specified column should be hidden.
\param column column index
\param hidden set to true to hide column
\see columnHidden()
%End
Qt::SortOrder sortOrder() const;
2017-04-04 08:44:22 +02:00
%Docstring
Get the sort order
.. versionadded:: 2.16
:rtype: Qt.SortOrder
2017-04-04 08:44:22 +02:00
%End
void setSortOrder( Qt::SortOrder sortOrder );
2017-04-04 08:44:22 +02:00
%Docstring
Set the sort order
.. versionadded:: 2.16
%End
bool operator!= ( const QgsAttributeTableConfig &other ) const;
%Docstring
Compare this configuration to other.
%End
};
2017-04-04 08:44:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributetableconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/