QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
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
28
30
31#define SIP_NO_FILE
32
33
40class GUI_EXPORT QgsProcessingHelpEditorWidget : public QWidget, public Ui::QgsProcessingHelpEditorWidgetBase
41{
42 Q_OBJECT
43 public:
44
48 QgsProcessingHelpEditorWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
49 ~QgsProcessingHelpEditorWidget() override;
50
54 void setAlgorithm( const QgsProcessingAlgorithm *algorithm );
55
59 QVariantMap helpContent();
60
61 private slots:
62
63 void updateHtmlView();
64
65 void changeItem( QTreeWidgetItem *current, QTreeWidgetItem *previous );
66
67 private:
68
69 QString formattedHelp() const;
70
71 void storeCurrentValue();
72
73 QVariantMap mHelpContent;
74
75 QString mCurrentName;
76
77 std::unique_ptr< QgsProcessingAlgorithm > mAlgorithm;
78
79 static const QString ALGORITHM_DESCRIPTION;
80 static const QString ALGORITHM_CREATOR;
81 static const QString ALGORITHM_HELP_CREATOR;
82 static const QString ALGORITHM_VERSION;
83 static const QString ALGORITHM_SHORT_DESCRIPTION;
84 static const QString ALGORITHM_HELP_URL;
85 static const QString ALGORITHM_EXAMPLES;
86
87};
88
95class GUI_EXPORT QgsProcessingHelpEditorDialog : public QDialog
96{
97 Q_OBJECT
98
99 public:
100
104 QgsProcessingHelpEditorDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
105
109 void setAlgorithm( const QgsProcessingAlgorithm *algorithm );
110
114 QVariantMap helpContent();
115
116 private:
117
118 QgsProcessingHelpEditorWidget *mWidget = nullptr;
119};
120
121
123
124#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