18 #ifndef QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
19 #define QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
27 #include <QItemDelegate>
28 #include <QAbstractTableModel>
29 #include <QSortFilterProxyModel>
32 #include "ui_qgslayoutattributeselectiondialogbase.h"
41 class QgsLayoutTableAvailableSortProxyModel;
88 virtual QVector<QgsLayoutTableColumn> &
columns()
const = 0;
93 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
94 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
95 QVariant data(
const QModelIndex &index,
int role )
const override;
96 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
97 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
98 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
99 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
100 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
101 QModelIndex index(
int row,
int column,
const QModelIndex &parent )
const override;
102 QModelIndex parent(
const QModelIndex &child )
const override;
140 QVector<QgsLayoutTableColumn> &columns()
const override;
144 return {Attribute, Heading, Alignment, Width};
176 QVector<QgsLayoutTableColumn> &columns()
const override;
180 return {Attribute, SortOrder};
198 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
199 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
200 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
201 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
218 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
219 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
220 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
221 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
223 void commitAndCloseEditor();
244 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
245 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
246 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
247 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
265 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
266 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
267 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
268 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
288 void mRemoveColumnPushButton_clicked();
289 void mAddColumnPushButton_clicked();
290 void mColumnUpPushButton_clicked();
291 void mColumnDownPushButton_clicked();
292 void mResetColumnsPushButton_clicked();
293 void mClearColumnsPushButton_clicked();
294 void mAddSortColumnPushButton_clicked();
295 void mRemoveSortColumnPushButton_clicked();
296 void mSortColumnUpPushButton_clicked();
297 void mSortColumnDownPushButton_clicked();
Abstract interface for generating an expression context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A dialog to select what attributes to display (in the table item), set the column properties and spec...
A base model to hold the displaying or sortings columns used in a QgsLayoutAttributeTable.
Column
Available columns for the configuration table to be used by the model.
@ Width
Defines the width of the column.
@ Heading
Defines the title of the column.
@ Attribute
Attribute for a field or an expression.
@ Alignment
Defines the alignment of the column.
virtual QList< Column > displayedColumns() const =0
To be reimplemented to choose which column should be used by the model.
ShiftDirection
Controls whether a row/column is shifted up or down.
@ ShiftUp
Shift the row/column up.
virtual QVector< QgsLayoutTableColumn > & columns() const =0
To be reimplemented to provide the display or the sort columns.
A model for displaying columns shown in a QgsLayoutAttributeTable.
QList< Column > displayedColumns() const override
To be reimplemented to choose which column should be used by the model.
QgsLayoutAttributeTableColumnModel(QgsLayoutItemAttributeTable *table, QObject *parent=nullptr)
Constructor for QgsLayoutAttributeTableColumnModel.
A delegate for showing column alignment as a combo box.
A delegate for showing column sort order as a combo box.
A delegate for showing column attribute source as a QgsFieldExpressionWidget.
A delegate for showing column width as a spin box.
A layout table subclass that displays attributes from a vector layer.
A base class for objects which belong to a layout.
Stores properties of a column for a QgsLayoutTable.
Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted.
QList< Column > displayedColumns() const override
To be reimplemented to choose which column should be used by the model.
QgsLayoutTableSortModel(QgsLayoutItemAttributeTable *table, QObject *parent=nullptr)
Constructor for QgsLayoutTableSortColumnsProxyModel.
Represents a vector layer which manages a vector based data sets.