16#ifndef QGSPROCESSINGDEFAULTSTYLEDIALOG_H
17#define QGSPROCESSINGDEFAULTSTYLEDIALOG_H
19#include "ui_qgsprocessingdefaultstylesdialogbase.h"
25#include <QStyledItemDelegate>
33class QgsProcessingDefaultStyleDelegate :
public QStyledItemDelegate
38 explicit QgsProcessingDefaultStyleDelegate( QObject *parent =
nullptr );
40 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
42 void setEditorData( QWidget *editor,
const QModelIndex &index )
const override;
44 void setModelData( QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index )
const override;
46 void updateEditorGeometry( QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
50class QgsProcessingDefaultStylesModel :
public QAbstractTableModel
55 explicit QgsProcessingDefaultStylesModel(
const QgsProcessingAlgorithm *
algorithm, QObject *parent =
nullptr );
57 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
58 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
59 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
60 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
61 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
62 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
81 QVector<OutputItem> mItems;
104 void showEvent( QShowEvent *event )
override;
108 QgsProcessingDefaultStylesModel *mModel =
nullptr;
109 QgsProcessingDefaultStyleDelegate *mDelegate =
nullptr;
110 bool mInitialWidthsSet =
false;
Abstract base class for processing algorithms.
void showEvent(QShowEvent *event) override
QgsProcessingDefaultStyleDialog(const QgsProcessingAlgorithm *algorithm, QWidget *parent=nullptr)
Constructor for QgsProcessingDefaultStyleDialog.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call