QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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
85 void setOptions( const QString &options );
86
90 void setType( QgsRasterFormatSaveOptionsWidget::Type type = Default );
91
96 {
97 mPyramids = true;
98 mPyramidsFormat = format;
99 }
100
101 public slots:
102
103 void apply();
104
109 void helpOptions();
110
114 QString validateOptions( bool gui = true, bool reportOk = true );
115
119 void updateProfiles();
120
121 private slots:
122
123 void mProfileNewButton_clicked() SIP_FORCE;
124 void mProfileDeleteButton_clicked() SIP_FORCE;
125 void mProfileResetButton_clicked() SIP_FORCE;
126 void mOptionsAddButton_clicked() SIP_FORCE;
127 void mOptionsDeleteButton_clicked() SIP_FORCE;
128 void mOptionsLineEdit_editingFinished() SIP_FORCE;
129 void optionsTableChanged() SIP_FORCE;
130 void optionsTableEnableDeleteButton() SIP_FORCE;
131 void updateOptions() SIP_FORCE;
132 void swapOptionsUI( int newIndex = -1 ) SIP_FORCE;
133 void updateControls() SIP_FORCE;
134
135 protected:
136 void showEvent( QShowEvent *event ) override;
137
138 signals:
139 void optionsChanged();
140
141 private:
142
143 QString mFormat;
144 QString mProvider;
145 QgsRasterLayer *mRasterLayer = nullptr;
146 QString mRasterFileName;
147 QMap< QString, QString> mOptionsMap;
148 static QMap< QString, QStringList > sBuiltinProfiles;
149 bool mPyramids = false;
150 Qgis::RasterPyramidFormat mPyramidsFormat = Qgis::RasterPyramidFormat::GeoTiff;
151 int mBlockOptionUpdates = 0;
152
153 QString settingsKey( QString profile ) const SIP_FORCE;
154 QString currentProfileKey() const SIP_FORCE;
155 QString createOptions( const QString &profile ) const SIP_FORCE;
156 void deleteCreateOptions( const QString &profile ) SIP_FORCE;
157 void setCreateOptions() SIP_FORCE;
158 void setCreateOptions( const QString &profile, const QString &options ) SIP_FORCE;
159 void setCreateOptions( const QString &profile, const QStringList &list ) SIP_FORCE;
160 QStringList profiles() const SIP_FORCE;
161 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
162 QString pseudoFormat() const SIP_FORCE;
163
164};
165
166// clazy:excludeall=qstring-allocations
167
168#endif // QGSRASTERLAYERSAVEASDIALOG_H
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:55
RasterPyramidFormat
Raster pyramid formats.
Definition: qgis.h:2918
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