QGIS API Documentation 3.99.0-Master (c22de0620c0)
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
23#include "ui_qgslayoutimageexportoptions.h"
24
25#include "qgis_gui.h"
26
27#include <QDialog>
28
29#define SIP_NO_FILE
30
37class GUI_EXPORT QgsLayoutImageExportOptionsDialog : public QDialog, private Ui::QgsLayoutImageExportOptionsDialog
38{
39 Q_OBJECT
40
41 public:
48 QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, const QString &fileExtension = QString(), Qt::WindowFlags flags = Qt::WindowFlags() );
49
55 void setResolution( double resolution );
56
62 double resolution() const;
63
69 void setImageSize( QSizeF size );
70
75 int imageWidth() const;
76
81 int imageHeight() const;
82
88 void setCropToContents( bool crop );
89
94 bool cropToContents() const;
95
100 void setGenerateWorldFile( bool generate );
101
106 bool generateWorldFile() const;
107
112 void setAntialiasing( bool antialias );
113
118 bool antialiasing() const;
119
127 void getCropMargins( int &topMargin, int &rightMargin, int &bottomMargin, int &leftMargin ) const;
128
136 void setCropMargins( int topMargin, int rightMargin, int bottomMargin, int leftMargin );
137
139 void setOpenAfterExporting( bool enabled );
141 bool openAfterExporting() const;
142
143
145 void setQuality( int quality );
147 int quality() const;
148
149 private slots:
150
151 void mWidthSpinBox_valueChanged( int value );
152 void mHeightSpinBox_valueChanged( int value );
153 void mResolutionSpinBox_valueChanged( int value );
154 void clipToContentsToggled( bool state );
155 void showHelp();
156
157 private:
158 bool shouldShowQuality() const;
159 QSizeF mImageSize;
160 QString mFileExtension;
161};
162
163#endif // QGSLAYOUTIMAGEEXPORTOPTIONSDIALOG_H
bool antialiasing() const
Returns whether antialiasing should be used in the export.
void setQuality(int quality)
Sets the image quality (for JPEG).
void setCropToContents(bool crop)
Sets whether the crop to contents option should be checked in the dialog.
void setImageSize(QSizeF size)
Sets the target image size.
void setAntialiasing(bool antialias)
Sets whether antialiasing should be used in the export.
int quality() const
Returns the image quality.
double resolution() const
Returns the selected resolution from the dialog.
QgsLayoutImageExportOptionsDialog(QWidget *parent=nullptr, const QString &fileExtension=QString(), Qt::WindowFlags flags=Qt::WindowFlags())
Constructor for QgsLayoutImageExportOptionsDialog.
int imageWidth() const
Returns the user-set image width in pixels.
bool cropToContents() const
Returns whether the crop to contents option is checked in the dialog.
void setOpenAfterExporting(bool enabled)
Sets whether to open the pdf after exporting it.
bool generateWorldFile() const
Returns whether the generate world file option is checked in the dialog.
void setCropMargins(int topMargin, int rightMargin, int bottomMargin, int leftMargin)
Sets the current crop to contents margin values, in pixels.
void setResolution(double resolution)
Sets the initial resolution displayed in the dialog.
void getCropMargins(int &topMargin, int &rightMargin, int &bottomMargin, int &leftMargin) const
Fetches the current crop to contents margin values, in pixels.
int imageHeight() const
Returns the user-set image height in pixels.
void setGenerateWorldFile(bool generate)
Sets whether the generate world file option should be checked.
bool openAfterExporting() const
Returns whether the pdf should be opened after exporting it.