16#ifndef QGSATTRIBUTETABLECONFIG_H
17#define QGSATTRIBUTETABLECONFIG_H
85 QVector<QgsAttributeTableConfig::ColumnConfig>
columns()
const;
105 sipRes = sipCpp->size();
121 void setColumns(
const QVector<QgsAttributeTableConfig::ColumnConfig> &
columns );
154 void writeXml( QDomNode &node )
const;
159 void readXml(
const QDomNode &node );
191 if ( a0 < 0 || a0 >= sipCpp->size() )
193 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
198 return PyLong_FromLong( sipCpp->columnWidth( a0 ) );
213 void setColumnWidth(
int column,
int width );
224 void setColumnWidth(
int column,
int width );
226 if ( a0 < 0 || a0 >= sipCpp->size() )
228 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
233 sipCpp->setColumnWidth( a0, a1 );
246 bool columnHidden(
int column )
const;
256 bool columnHidden(
int column )
const;
259 if ( a0 < 0 || a0 >= sipCpp->size() )
261 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
266 return PyBool_FromLong( sipCpp->columnHidden( a0 ) );
281 void setColumnHidden(
int column,
bool hidden );
292 void setColumnHidden(
int column,
bool hidden );
294 if ( a0 < 0 || a0 >= sipCpp->size() )
296 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
301 sipCpp->setColumnHidden( a0, a1 );
310 Qt::SortOrder sortOrder()
const;
315 void setSortOrder( Qt::SortOrder sortOrder );
321 bool hasSameColumns(
const QgsAttributeTableConfig &other )
const;
323 bool operator!=(
const QgsAttributeTableConfig &other )
const;
326 QVector<ColumnConfig> mColumns;
327 ActionWidgetStyle mActionWidgetStyle = DropDown;
328 QString mSortExpression;
329 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.