QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsrasterformatsaveoptionswidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterformatsaveoptionswidget.h
3 -------------------
4 begin : July 2012
5 copyright : (C) 2012 by Etienne Tourigny
6 email : etourigny dot dev at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERFORMATSAVEOPTIONSWIDGET_H
19#define QGSRASTERFORMATSAVEOPTIONSWIDGET_H
20
21#include "ui_qgsrasterformatsaveoptionswidgetbase.h"
22#include "qgsraster.h"
23#include "qgis_gui.h"
24
25class QgsRasterLayer;
26
31class GUI_EXPORT QgsRasterFormatSaveOptionsWidget : public QWidget, private Ui::QgsRasterFormatSaveOptionsWidgetBase
32{
33 Q_OBJECT
34
35 public:
36 enum Type
37 {
38 Default, // everything except profile buttons (save as dlg)
39 Full, // everything (options dlg)
40 Table, // just table
41 LineEdit, // just the line edit
42 ProfileLineEdit // Profile + LineEdit
43 };
44
45 QgsRasterFormatSaveOptionsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &format = "GTiff", QgsRasterFormatSaveOptionsWidget::Type type = Default, const QString &provider = "gdal" );
46
51 void setFormat( const QString &format );
52
57 void setProvider( const QString &provider );
58
62 void setRasterLayer( QgsRasterLayer *rasterLayer )
63 {
64 mRasterLayer = rasterLayer;
65 mRasterFileName = QString();
66 }
67
71 void setRasterFileName( const QString &file )
72 {
73 mRasterLayer = nullptr;
74 mRasterFileName = file;
75 }
76
81 QStringList options() const;
82
88 void setOptions( const QString &options );
89
93 void setType( QgsRasterFormatSaveOptionsWidget::Type type = Default );
94
99 {
100 mPyramids = true;
101 mPyramidsFormat = format;
102 }
103
104 public slots:
105
106 void apply();
107
112 void helpOptions();
113
117 QString validateOptions( bool gui = true, bool reportOk = true );
118
122 void updateProfiles();
123
124 private slots:
125
126 void mProfileNewButton_clicked() SIP_FORCE;
127 void mProfileDeleteButton_clicked() SIP_FORCE;
128 void mProfileResetButton_clicked() SIP_FORCE;
129 void mOptionsAddButton_clicked() SIP_FORCE;
130 void mOptionsDeleteButton_clicked() SIP_FORCE;
131 void mOptionsLineEdit_editingFinished() SIP_FORCE;
132 void optionsTableChanged() SIP_FORCE;
133 void optionsTableEnableDeleteButton() SIP_FORCE;
134 void updateOptions() SIP_FORCE;
135 void swapOptionsUI( int newIndex = -1 ) SIP_FORCE;
136 void updateControls() SIP_FORCE;
137
138 protected:
139 void showEvent( QShowEvent *event ) override;
140
141 signals:
142
146 void optionsChanged();
147
148 private:
149 QString mFormat;
150 QString mProvider;
151 QgsRasterLayer *mRasterLayer = nullptr;
152 QString mRasterFileName;
153 QMap<QString, QString> mOptionsMap;
154 static QMap<QString, QStringList> sBuiltinProfiles;
155 bool mPyramids = false;
156 Qgis::RasterPyramidFormat mPyramidsFormat = Qgis::RasterPyramidFormat::GeoTiff;
157 int mBlockOptionUpdates = 0;
158
159 QString settingsKey( QString profile ) const SIP_FORCE;
160 QString currentProfileKey() const SIP_FORCE;
161 QString createOptions( const QString &profile ) const SIP_FORCE;
162 void deleteCreateOptions( const QString &profile ) SIP_FORCE;
163 void setCreateOptions() SIP_FORCE;
164 void setCreateOptions( const QString &profile, const QString &options ) SIP_FORCE;
165 void setCreateOptions( const QString &profile, const QStringList &list ) SIP_FORCE;
166 QStringList profiles() const SIP_FORCE;
167 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
168 QString pseudoFormat() const SIP_FORCE;
169};
170
171// clazy:excludeall=qstring-allocations
172
173#endif // QGSRASTERLAYERSAVEASDIALOG_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
RasterPyramidFormat
Raster pyramid formats.
Definition qgis.h:4529
A widget to select format-specific raster saving options.
void setRasterLayer(QgsRasterLayer *rasterLayer)
Set output raster layer.
void setPyramidsFormat(Qgis::RasterPyramidFormat format)
Set pyramids format to use.
void setRasterFileName(const QString &file)
Set output raster file name.
Represents a raster layer.
#define SIP_FORCE
Definition qgis_sip.h:131
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53