18#ifndef QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
19#define QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
27#include <QItemDelegate>
28#include <QAbstractTableModel>
29#include <QSortFilterProxyModel>
32#include "ui_qgslayoutattributeselectiondialogbase.h"
41class 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;
225 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
226 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
227 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
228 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
230 void commitAndCloseEditor();
234 bool mForceExpressions =
false;
252 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
253 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
254 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
255 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
273 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
274 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
275 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
276 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
296 void mRemoveColumnPushButton_clicked();
297 void mAddColumnPushButton_clicked();
298 void mColumnUpPushButton_clicked();
299 void mColumnDownPushButton_clicked();
300 void mResetColumnsPushButton_clicked();
301 void mClearColumnsPushButton_clicked();
302 void mAddSortColumnPushButton_clicked();
303 void mRemoveSortColumnPushButton_clicked();
304 void mSortColumnUpPushButton_clicked();
305 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 QVector< QgsLayoutTableColumn > & columns() const =0
To be reimplemented to provide the display or the sort columns.
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.
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.
QgsLayoutTableSortModel(QgsLayoutItemAttributeTable *table, QObject *parent=nullptr)
Constructor for QgsLayoutTableSortColumnsProxyModel.
QList< Column > displayedColumns() const override
To be reimplemented to choose which column should be used by the model.
Represents a vector layer which manages a vector based data sets.