16#ifndef QGSATTRIBUTETABLECONFIG_H
17#define QGSATTRIBUTETABLECONFIG_H
90 Q_ENUM( AddFeatureMethod )
119 sipRes = sipCpp->size();
135 void setColumns(
const QVector<QgsAttributeTableConfig::ColumnConfig> &
columns );
168 void writeXml( QDomNode &node )
const;
173 void readXml(
const QDomNode &node );
219 if ( a0 < 0 || a0 >= sipCpp->size() )
221 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
226 return PyLong_FromLong( sipCpp->columnWidth( a0 ) );
241 void setColumnWidth(
int column,
int width );
252 void setColumnWidth(
int column,
int width );
254 if ( a0 < 0 || a0 >= sipCpp->size() )
256 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
261 sipCpp->setColumnWidth( a0, a1 );
274 bool columnHidden(
int column )
const;
284 bool columnHidden(
int column )
const;
287 if ( a0 < 0 || a0 >= sipCpp->size() )
289 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
294 return PyBool_FromLong( sipCpp->columnHidden( a0 ) );
309 void setColumnHidden(
int column,
bool hidden );
320 void setColumnHidden(
int column,
bool hidden );
322 if ( a0 < 0 || a0 >= sipCpp->size() )
324 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
329 sipCpp->setColumnHidden( a0, a1 );
338 Qt::SortOrder sortOrder()
const;
343 void setSortOrder( Qt::SortOrder sortOrder );
349 bool hasSameColumns(
const QgsAttributeTableConfig &other )
const;
351 bool operator!=(
const QgsAttributeTableConfig &other )
const;
354 QVector<ColumnConfig> mColumns;
355 ActionWidgetStyle mActionWidgetStyle = DropDown;
356 QString mSortExpression;
357 Qt::SortOrder mSortOrder = Qt::AscendingOrder;
358 AddFeatureMethod mAddFeatureMethod = AddFeatureMethod::Unset;
void setAddFeatureMethod(const AddFeatureMethod addFeatureMethod)
Sets the addFeatureMethod that defines how features are added (single form or embedded in a table).
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.
AddFeatureMethod addFeatureMethod() const
Returns the method that defines how features are added (single form or embedded in a table).
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.
AddFeatureMethod
The way to add features in the attribute table.
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.