QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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
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
142 void optionsChanged();
143
144 private:
145
146 QString mFormat;
147 QString mProvider;
148 QgsRasterLayer *mRasterLayer = nullptr;
149 QString mRasterFileName;
150 QMap< QString, QString> mOptionsMap;
151 static QMap< QString, QStringList > sBuiltinProfiles;
152 bool mPyramids = false;
153 Qgis::RasterPyramidFormat mPyramidsFormat = Qgis::RasterPyramidFormat::GeoTiff;
154 int mBlockOptionUpdates = 0;
155
156 QString settingsKey( QString profile ) const SIP_FORCE;
157 QString currentProfileKey() const SIP_FORCE;
158 QString createOptions( const QString &profile ) const SIP_FORCE;
159 void deleteCreateOptions( const QString &profile ) SIP_FORCE;
160 void setCreateOptions() SIP_FORCE;
161 void setCreateOptions( const QString &profile, const QString &options ) SIP_FORCE;
162 void setCreateOptions( const QString &profile, const QStringList &list ) SIP_FORCE;
163 QStringList profiles() const SIP_FORCE;
164 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
165 QString pseudoFormat() const SIP_FORCE;
166
167};
168
169// clazy:excludeall=qstring-allocations
170
171#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:4458
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