QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsprocessingoutputdestinationwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingoutputdestinationwidget.h
3 ----------------------------------
4 Date : March 2020
5 Copyright : (C) 2020 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 QGSPROCESSINGOUTPUTDESTINATIONWIDGET_H
17#define QGSPROCESSINGOUTPUTDESTINATIONWIDGET_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "ui_qgsprocessingdestinationwidgetbase.h"
24#include <QWidget>
25
28class QCheckBox;
30
37class GUI_EXPORT QgsProcessingLayerOutputDestinationWidget : public QWidget, private Ui::QgsProcessingDestinationWidgetBase
38{
39 Q_OBJECT
40
41 public:
45 QgsProcessingLayerOutputDestinationWidget( const QgsProcessingDestinationParameter *parameter, bool defaultSelection, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46
50 bool outputIsSkipped() const;
51
55 void setValue( const QVariant &value );
56
60 QVariant value() const;
61
67 void setWidgetContext( const QgsProcessingParameterWidgetContext &context );
68
72 void setContext( QgsProcessingContext *context );
73
80 void registerProcessingParametersGenerator( QgsProcessingParametersGenerator *generator );
81
85 void addOpenAfterRunningOption();
86
90 bool openAfterRunning() const;
91
92 signals:
93
97 void skipOutputChanged( bool skipped );
98
102 void destinationChanged();
103
104 protected:
105 void dragEnterEvent( QDragEnterEvent *event ) override;
106 void dragLeaveEvent( QDragLeaveEvent *event ) override;
107 void dropEvent( QDropEvent *event ) override;
108
109 private slots:
110
111 void menuAboutToShow();
112 void skipOutput();
113 void saveToTemporary();
114 void selectDirectory();
115 void selectFile();
116 void saveToGeopackage();
117 void saveToDatabase();
118 void appendToLayer();
119 void selectEncoding();
120 void textChanged( const QString &text );
121
122 private:
123 void setAppendDestination( const QString &uri, const QgsFields &destFields );
124
125 QString mimeDataToPath( const QMimeData *data );
126
127 const QgsProcessingDestinationParameter *mParameter = nullptr;
128 QgsProcessingParametersGenerator *mParametersGenerator = nullptr;
129 QMenu *mMenu = nullptr;
130
131 bool mUseTemporary = true;
132 bool mDefaultSelection = false;
133 QString mEncoding;
134 QgsBrowserGuiModel *mBrowserModel = nullptr;
135 QCheckBox *mOpenAfterRunningCheck = nullptr;
136
137 QgsRemappingSinkDefinition mRemapDefinition;
138 bool mUseRemapping = false;
139
140 QgsProcessingContext *mContext = nullptr;
141
142 friend class TestProcessingGui;
143};
144
146
147#endif // QGSPROCESSINGOUTPUTDESTINATIONWIDGET_H
A model for showing available data sources and other items in a structured tree.
Container of fields for a vector layer.
Definition qgsfields.h:46
Contains information about the context in which a processing algorithm is executed.
Base class for all parameter definitions which represent file or layer destinations,...
Contains settings which reflect the context in which a Processing parameter widget is shown,...
An interface for objects which can create sets of parameter values for processing algorithms.
Defines the parameters used to remap features when creating a QgsRemappingProxyFeatureSink.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53