QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgslayoutimageexportoptionsdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutimageexportoptionsdialog.h
3 -------------------------------------
4 begin : December 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson 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 QGSLAYOUTIMAGEEXPORTOPTIONSDIALOG_H
19#define QGSLAYOUTIMAGEEXPORTOPTIONSDIALOG_H
20
21// We don't want to expose this in the public API
22#define SIP_NO_FILE
23
24#include <QDialog>
25#include "qgis_gui.h"
26#include "ui_qgslayoutimageexportoptions.h"
27
28
35class GUI_EXPORT QgsLayoutImageExportOptionsDialog : public QDialog, private Ui::QgsLayoutImageExportOptionsDialog
36{
37 Q_OBJECT
38
39 public:
46 QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, const QString &fileExtension = QString(), Qt::WindowFlags flags = Qt::WindowFlags() );
47
53 void setResolution( double resolution );
54
60 double resolution() const;
61
67 void setImageSize( QSizeF size );
68
73 int imageWidth() const;
74
79 int imageHeight() const;
80
86 void setCropToContents( bool crop );
87
92 bool cropToContents() const;
93
98 void setGenerateWorldFile( bool generate );
99
104 bool generateWorldFile() const;
105
110 void setAntialiasing( bool antialias );
111
116 bool antialiasing() const;
117
125 void getCropMargins( int &topMargin, int &rightMargin, int &bottomMargin, int &leftMargin ) const;
126
134 void setCropMargins( int topMargin, int rightMargin, int bottomMargin, int leftMargin );
135
137 void setOpenAfterExporting( bool enabled );
139 bool openAfterExporting() const;
140
141
143 void setQuality( int quality );
145 int quality() const;
146
147 private slots:
148
149 void mWidthSpinBox_valueChanged( int value );
150 void mHeightSpinBox_valueChanged( int value );
151 void mResolutionSpinBox_valueChanged( int value );
152 void clipToContentsToggled( bool state );
153 void showHelp();
154
155 private:
156 bool shouldShowQuality() const;
157 QSizeF mImageSize;
158 QString mFileExtension;
159};
160
161#endif // QGSLAYOUTIMAGEEXPORTOPTIONSDIALOG_H
A dialog for customizing the properties of an exported image file.