18#ifndef QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
19#define QGSLAYOUTATTRIBUTESELECTIONDIALOG_H
27#include <QItemDelegate>
28#include <QAbstractTableModel>
29#include <QSortFilterProxyModel>
32#include "ui_qgslayoutattributeselectiondialogbase.h"
41class QgsLayoutTableAvailableSortProxyModel;
87 virtual QVector<QgsLayoutTableColumn> &
columns()
const = 0;
92 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
93 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
94 QVariant data(
const QModelIndex &index,
int role )
const override;
95 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
96 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
97 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
98 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
99 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
100 QModelIndex index(
int row,
int column,
const QModelIndex &parent )
const override;
101 QModelIndex parent(
const QModelIndex &child )
const override;
137 QVector<QgsLayoutTableColumn> &columns()
const override;
141 return { Attribute, Heading, Alignment, Width };
172 QVector<QgsLayoutTableColumn> &columns()
const override;
176 return { Attribute, SortOrder };
194 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
195 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
196 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
197 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
220 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
221 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
222 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
223 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
225 void commitAndCloseEditor();
230 bool mForceExpressions =
false;
248 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
249 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
250 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
251 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
268 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
269 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
270 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
271 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
290 void mRemoveColumnPushButton_clicked();
291 void mAddColumnPushButton_clicked();
292 void mColumnUpPushButton_clicked();
293 void mColumnDownPushButton_clicked();
294 void mResetColumnsPushButton_clicked();
295 void mClearColumnsPushButton_clicked();
296 void mAddSortColumnPushButton_clicked();
297 void mRemoveSortColumnPushButton_clicked();
298 void mSortColumnUpPushButton_clicked();
299 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 sorting 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.