QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsprocessinghelpeditorwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessinghelpeditorwidget.h
3 ------------------------
4 Date : February 2022
5 Copyright : (C) 2022 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSPROCESSINGHELPEDITORWIDGET_H
17#define QGSPROCESSINGHELPEDITORWIDGET_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "ui_qgsprocessinghelpeditorwidgetbase.h"
22
23#include <QDialog>
24
26
27
29
30#define SIP_NO_FILE
31
32
39class GUI_EXPORT QgsProcessingHelpEditorWidget : public QWidget, public Ui::QgsProcessingHelpEditorWidgetBase
40{
41 Q_OBJECT
42 public:
46 QgsProcessingHelpEditorWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
47 ~QgsProcessingHelpEditorWidget() override;
48
52 void setAlgorithm( const QgsProcessingAlgorithm *algorithm );
53
57 QVariantMap helpContent();
58
59 private slots:
60
61 void updateHtmlView();
62
63 void changeItem( QTreeWidgetItem *current, QTreeWidgetItem *previous );
64
65 private:
66 QString formattedHelp() const;
67
68 void storeCurrentValue();
69
70 QVariantMap mHelpContent;
71
72 QString mCurrentName;
73
74 std::unique_ptr<QgsProcessingAlgorithm> mAlgorithm;
75
76 static const QString ALGORITHM_DESCRIPTION;
77 static const QString ALGORITHM_CREATOR;
78 static const QString ALGORITHM_HELP_CREATOR;
79 static const QString ALGORITHM_VERSION;
80 static const QString ALGORITHM_SHORT_DESCRIPTION;
81 static const QString ALGORITHM_HELP_URL;
82 static const QString ALGORITHM_EXAMPLES;
83};
84
91class GUI_EXPORT QgsProcessingHelpEditorDialog : public QDialog
92{
93 Q_OBJECT
94
95 public:
99 QgsProcessingHelpEditorDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
100
104 void setAlgorithm( const QgsProcessingAlgorithm *algorithm );
105
109 QVariantMap helpContent();
110
111 private:
112 QgsProcessingHelpEditorWidget *mWidget = nullptr;
113};
114
115
117
118#endif // QGSPROCESSINGHELPEDITORWIDGET_H
Abstract base class for processing algorithms.
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
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53