QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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
37 enum Type
38 {
39 Default, // everything except profile buttons (save as dlg)
40 Full, // everything (options dlg)
41 Table, // just table
42 LineEdit, // just the line edit
43 ProfileLineEdit // Profile + LineEdit
44 };
45
46 QgsRasterFormatSaveOptionsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr,
47 const QString &format = "GTiff",
49 const QString &provider = "gdal" );
50
55 void setFormat( const QString &format );
56
61 void setProvider( const QString &provider );
62
66 void setRasterLayer( QgsRasterLayer *rasterLayer ) { mRasterLayer = rasterLayer; mRasterFileName = QString(); }
67
71 void setRasterFileName( const QString &file ) { mRasterLayer = nullptr; mRasterFileName = file; }
72
77 QStringList options() const;
78
84 void setOptions( const QString &options );
85
89 void setType( QgsRasterFormatSaveOptionsWidget::Type type = Default );
90
95 {
96 mPyramids = true;
97 mPyramidsFormat = format;
98 }
99
100 public slots:
101
102 void apply();
103
108 void helpOptions();
109
113 QString validateOptions( bool gui = true, bool reportOk = true );
114
118 void updateProfiles();
119
120 private slots:
121
122 void mProfileNewButton_clicked() SIP_FORCE;
123 void mProfileDeleteButton_clicked() SIP_FORCE;
124 void mProfileResetButton_clicked() SIP_FORCE;
125 void mOptionsAddButton_clicked() SIP_FORCE;
126 void mOptionsDeleteButton_clicked() SIP_FORCE;
127 void mOptionsLineEdit_editingFinished() SIP_FORCE;
128 void optionsTableChanged() SIP_FORCE;
129 void optionsTableEnableDeleteButton() SIP_FORCE;
130 void updateOptions() SIP_FORCE;
131 void swapOptionsUI( int newIndex = -1 ) SIP_FORCE;
132 void updateControls() SIP_FORCE;
133
134 protected:
135 void showEvent( QShowEvent *event ) override;
136
137 signals:
138 void optionsChanged();
139
140 private:
141
142 QString mFormat;
143 QString mProvider;
144 QgsRasterLayer *mRasterLayer = nullptr;
145 QString mRasterFileName;
146 QMap< QString, QString> mOptionsMap;
147 static QMap< QString, QStringList > sBuiltinProfiles;
148 bool mPyramids = false;
149 Qgis::RasterPyramidFormat mPyramidsFormat = Qgis::RasterPyramidFormat::GeoTiff;
150 int mBlockOptionUpdates = 0;
151
152 QString settingsKey( QString profile ) const SIP_FORCE;
153 QString currentProfileKey() const SIP_FORCE;
154 QString createOptions( const QString &profile ) const SIP_FORCE;
155 void deleteCreateOptions( const QString &profile ) SIP_FORCE;
156 void setCreateOptions() SIP_FORCE;
157 void setCreateOptions( const QString &profile, const QString &options ) SIP_FORCE;
158 void setCreateOptions( const QString &profile, const QStringList &list ) SIP_FORCE;
159 QStringList profiles() const SIP_FORCE;
160 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
161 QString pseudoFormat() const SIP_FORCE;
162
163};
164
165// clazy:excludeall=qstring-allocations
166
167#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:3981
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