QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 "ui_qgsprocessingdestinationwidgetbase.h"
20
21#include "qgis.h"
22#include "qgis_gui.h"
25
26#include <QWidget>
27
30class QCheckBox;
32
39class GUI_EXPORT QgsProcessingLayerOutputDestinationWidget : public QWidget, private Ui::QgsProcessingDestinationWidgetBase
40{
41 Q_OBJECT
42
43 public:
47 QgsProcessingLayerOutputDestinationWidget( const QgsProcessingDestinationParameter *parameter, bool defaultSelection, QWidget *parent SIP_TRANSFERTHIS = nullptr );
48
52 bool outputIsSkipped() const;
53
57 void setValue( const QVariant &value );
58
62 QVariant value() const;
63
69 void setWidgetContext( const QgsProcessingParameterWidgetContext &context );
70
74 void setContext( QgsProcessingContext *context );
75
82 void registerProcessingParametersGenerator( QgsProcessingParametersGenerator *generator );
83
87 void addOpenAfterRunningOption();
88
92 bool openAfterRunning() const;
93
94 signals:
95
99 void skipOutputChanged( bool skipped );
100
104 void destinationChanged();
105
106 protected:
107 void dragEnterEvent( QDragEnterEvent *event ) override;
108 void dragLeaveEvent( QDragLeaveEvent *event ) override;
109 void dropEvent( QDropEvent *event ) override;
110
111 private slots:
112
113 void menuAboutToShow();
114 void skipOutput();
115 void saveToTemporary();
116 void selectDirectory();
117 void selectFile();
118 void saveToGeopackage();
119 void saveToDatabase();
120 void appendToLayer();
121 void selectEncoding();
122 void textChanged( const QString &text );
123
124 private:
125 void setAppendDestination( const QString &uri, const QgsFields &destFields );
126
127 QString mimeDataToPath( const QMimeData *data );
128
129 const QgsProcessingDestinationParameter *mParameter = nullptr;
130 QgsProcessingParametersGenerator *mParametersGenerator = nullptr;
131 QMenu *mMenu = nullptr;
132
133 bool mUseTemporary = true;
134 bool mDefaultSelection = false;
135 QString mEncoding;
136 QgsBrowserGuiModel *mBrowserModel = nullptr;
137 QCheckBox *mOpenAfterRunningCheck = nullptr;
138
139 QgsRemappingSinkDefinition mRemapDefinition;
140 bool mUseRemapping = false;
141
142 QgsProcessingContext *mContext = nullptr;
143
144 friend class TestProcessingGui;
145};
146
148
149#endif // QGSPROCESSINGOUTPUTDESTINATIONWIDGET_H
A model for showing available data sources and other items in a structured tree.
Base class for all parameter definitions which represent file or layer destinations,...
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53