16#ifndef QGSATTRIBUTETABLECONFIG_H
17#define QGSATTRIBUTETABLECONFIG_H
86 QVector<QgsAttributeTableConfig::ColumnConfig>
columns()
const;
105 sipRes = sipCpp->size();
120 void setColumns(
const QVector<QgsAttributeTableConfig::ColumnConfig> &
columns );
153 void writeXml( QDomNode &node )
const;
158 void readXml(
const QDomNode &node );
189 if ( a0 < 0 || a0 >= sipCpp->size() )
191 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
196 return PyLong_FromLong( sipCpp->columnWidth( a0 ) );
210 void setColumnWidth(
int column,
int width );
220 void setColumnWidth(
int column,
int width );
222 if ( a0 < 0 || a0 >= sipCpp->size() )
224 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
229 sipCpp->setColumnWidth( a0, a1 );
241 bool columnHidden(
int column )
const;
250 bool columnHidden(
int column )
const;
253 if ( a0 < 0 || a0 >= sipCpp->size() )
255 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
260 return PyBool_FromLong( sipCpp->columnHidden( a0 ) );
274 void setColumnHidden(
int column,
bool hidden );
284 void setColumnHidden(
int column,
bool hidden );
286 if ( a0 < 0 || a0 >= sipCpp->size() )
288 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
293 sipCpp->setColumnHidden( a0, a1 );
301 Qt::SortOrder sortOrder()
const;
306 void setSortOrder( Qt::SortOrder sortOrder );
312 bool hasSameColumns(
const QgsAttributeTableConfig &other )
const;
314 bool operator!= (
const QgsAttributeTableConfig &other )
const;
317 QVector<ColumnConfig> mColumns;
318 ActionWidgetStyle mActionWidgetStyle = DropDown;
319 QString mSortExpression;
320 Qt::SortOrder mSortOrder = Qt::AscendingOrder;
void setActionWidgetVisible(bool visible)
Set if the action widget is visible.
bool isEmpty() const
Returns true if the configuration is empty, ie it contains no columns.
void setSortExpression(const QString &sortExpression)
Set the sort expression used for sorting.
Type
The type of an attribute table column.
@ Action
This column represents an action widget.
@ Field
This column represents a field.
void readXml(const QDomNode &node)
Deserialize to XML on layer load.
QVector< QgsAttributeTableConfig::ColumnConfig > columns() const
Gets the list with all columns and their configuration.
int mapVisibleColumnToIndex(int visibleColumn) const
Maps a visible column index to its original column index.
void update(const QgsFields &fields)
Update the configuration with the given fields.
ActionWidgetStyle
The style of the action widget in the attribute table.
@ DropDown
A tool button with a drop-down to select the current action.
@ ButtonList
A list of buttons.
bool actionWidgetVisible() const
Returns true if the action widget is visible.
void setActionWidgetStyle(ActionWidgetStyle actionWidgetStyle)
Set the style of the action widget.
int columnWidth(int column) const
Returns the width of a column, or -1 if column should use default width.
QgsAttributeTableConfig()=default
void setColumns(const QVector< QgsAttributeTableConfig::ColumnConfig > &columns)
Set the list of columns visible in the attribute table.
ActionWidgetStyle actionWidgetStyle() const
Gets the style of the action widget.
QString sortExpression() const
Gets the expression used for sorting.
void writeXml(QDomNode &node) const
Serialize to XML on layer save.
int size() const
Returns the number of columns in the configuration.
Container of fields for a vector layer.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Defines the configuration of a column in the attribute table.
QgsAttributeTableConfig::Type type
The type of this column.
bool hidden
Flag that controls if the column is hidden.
int width
Width of column, or -1 for default width.
QString name
The name of the attribute if this column represents a field.