QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
23#include "qgis_gui.h"
24#include "qgsraster.h"
25
26class QgsRasterLayer;
27
32class GUI_EXPORT QgsRasterFormatSaveOptionsWidget : public QWidget, private Ui::QgsRasterFormatSaveOptionsWidgetBase
33{
34 Q_OBJECT
35
36 public:
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, const QString &format = "GTiff", QgsRasterFormatSaveOptionsWidget::Type type = Default, const QString &provider = "gdal" );
47
52 void setFormat( const QString &format );
53
58 void setProvider( const QString &provider );
59
63 void setRasterLayer( QgsRasterLayer *rasterLayer )
64 {
65 mRasterLayer = rasterLayer;
66 mRasterFileName = QString();
67 }
68
72 void setRasterFileName( const QString &file )
73 {
74 mRasterLayer = nullptr;
75 mRasterFileName = file;
76 }
77
82 QStringList options() const;
83
89 void setOptions( const QString &options );
90
94 void setType( QgsRasterFormatSaveOptionsWidget::Type type = Default );
95
100 {
101 mPyramids = true;
102 mPyramidsFormat = format;
103 }
104
105 public slots:
106
107 void apply();
108
113 void helpOptions();
114
118 QString validateOptions( bool gui = true, bool reportOk = true );
119
123 void updateProfiles();
124
125 private slots:
126
127 void mProfileNewButton_clicked() SIP_FORCE;
128 void mProfileDeleteButton_clicked() SIP_FORCE;
129 void mProfileResetButton_clicked() SIP_FORCE;
130 void mOptionsAddButton_clicked() SIP_FORCE;
131 void mOptionsDeleteButton_clicked() SIP_FORCE;
132 void mOptionsLineEdit_editingFinished() SIP_FORCE;
133 void optionsTableChanged() SIP_FORCE;
134 void optionsTableEnableDeleteButton() SIP_FORCE;
135 void updateOptions() SIP_FORCE;
136 void swapOptionsUI( int newIndex = -1 ) SIP_FORCE;
137 void updateControls() SIP_FORCE;
138
139 protected:
140 void showEvent( QShowEvent *event ) override;
141
142 signals:
143
148
149 private:
150 QString mFormat;
151 QString mProvider;
152 QgsRasterLayer *mRasterLayer = nullptr;
153 QString mRasterFileName;
154 QMap<QString, QString> mOptionsMap;
155 static QMap<QString, QStringList> sBuiltinProfiles;
156 bool mPyramids = false;
157 Qgis::RasterPyramidFormat mPyramidsFormat = Qgis::RasterPyramidFormat::GeoTiff;
158 int mBlockOptionUpdates = 0;
159
160 QString settingsKey( QString profile ) const SIP_FORCE;
161 QString currentProfileKey() const SIP_FORCE;
162 QString creationOptions( const QString &profile ) const SIP_FORCE;
163 void deleteCreationOptions( const QString &profile ) SIP_FORCE;
164 void setCreationOptions() SIP_FORCE;
165 void setCreationOptions( const QString &profile, const QString &options ) SIP_FORCE;
166 void setCreationOptions( const QString &profile, const QStringList &options ) SIP_FORCE;
167 QStringList profiles() const SIP_FORCE;
168 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
169 QString pseudoFormat() const SIP_FORCE;
170};
171
172// clazy:excludeall=qstring-allocations
173
174#endif // QGSRASTERLAYERSAVEASDIALOG_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
RasterPyramidFormat
Raster pyramid formats.
Definition qgis.h:4802
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.
QgsRasterFormatSaveOptionsWidget(QWidget *parent SIP_TRANSFERTHIS=nullptr, const QString &format="GTiff", QgsRasterFormatSaveOptionsWidget::Type type=Default, const QString &provider="gdal")
void setRasterFileName(const QString &file)
Set output raster file name.
void optionsChanged()
Emitted when the options configured in the widget are changed.
QStringList options() const
Returns list of selected options.
Represents a raster layer.
#define SIP_FORCE
Definition qgis_sip.h:139
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53