ImageExportDialog Class Reference

QFileDialog extended with options for image export. More...

`#include <ImageExportDialog.h>`

Inheritance diagram for ImageExportDialog:

## Public Slots

void | accept ()

## Public Member Functions

int | bitmapResolution () const
| For raster formats: returns the output resolution the user selected, defaulting to the screen resolution. More...
bool | color () const
| For vector formats: returns whether colors should be enabled for ouput (default: true). More...
int | compression () const
| For raster formats supporting this option returns the output image compression, 0 means no compression. More...
QSizeF | customExportSize ()
| Return the custom export size. More...
bool | escapeStrings ()
| For TeX format: returns whether special characters should be escaped for ouput (default: true). More...
bool | exportFontSizes ()
| For TeX format: returns whether font sizes should be exported (default: true). More...
| ImageExportDialog (MdiSubWindow *window, QWidget *parent=0, bool extended=true, Graph *g=0, Qt::WFlags flags=0)
| Constructor. More...
int | quality () const
| Return the quality (in percent) the user selected for export to raster formats. More...
double | scaleFontsFactor ()
| Return the scale fonts factor. More...
void | selectFilter (const QString &filter)
int | sizeUnit ()
| Return the unit used for the custom export size. More...
int | sortMode () const
| Return the sort export mode for 3D plots. More...
int | textExportMode () const
| Return the text export mode for 3D plots. More...
bool | transparency () const
| Return whether the output's background should be transparent. More...
int | vectorResolution () const
| For vector formats: returns the output resolution the user selected, defaulting to the screen resolution. More...
Public Member Functions inherited from ExtensibleFileDialog
| ExtensibleFileDialog (QWidget *parent=0, bool extended=true, Qt::WFlags flags=0)
| Constructor. More...
bool | isExtendable ()
| Tells weather the dialog has a valid extension widget. More...
bool | isExtended ()
void | setEditableFilter (bool on=true)
| Enables/Disables editing of the file type filter. More...
void | setExtended (bool extended)
| Toggle extension widget on/off. More...
void | setExtensionWidget (QWidget *extension)
| Set the extension widget to be displayed when the user presses the toggle button. More...
void | setExtentionToggleButtonText (const QString &text)
| Sets the text to be displayed in the toggle button. More...

## Protected Slots

void | adjustHeight (double width)
void | adjustWidth (double height)
void | closeEvent (QCloseEvent *)
void | drawPreview (QPrinter *)
void | drawVectorPreview (QPrinter *)
void | preview ()
void | updateAdvancedOptions (const QString &filter)
| Update which options are visible and enabled based on the output format. More...

## Private Member Functions

void | initAdvancedOptions ()
| Create d_advanced_options and everything it contains. More...

## Private Attributes

double | aspect_ratio
QLabel * | compressionLabel
QComboBox * | d_3D_export_sort
QComboBox * | d_3D_text_export_mode
QWidget * | d_advanced_options
| Container widget for all advanced options. More...
QSpinBox * | d_bitmap_resolution
QCheckBox * | d_color
QComboBox * | d_compression
QGroupBox * | d_custom_size_box
| Container widget for user defined export size. More...
QCheckBox * | d_escape_tex_strings
Graph * | d_layer
QPushButton * | d_preview_button
QSpinBox * | d_quality
QGroupBox * | d_raster_options
| Container widget for all options available for raster formats. More...
QCheckBox * | d_tex_font_sizes
QCheckBox * | d_transparency
QGroupBox * | d_vector_options
| Container widget for all options available for vector formats. More...
QSpinBox * | d_vector_resolution
MdiSubWindow * | d_window
| Pointer to the window to be exported. More...
DoubleSpinBox * | heightBox
QCheckBox * | keepRatioBox
QLabel * | resolutionLabel
DoubleSpinBox * | scaleFontsBox
QComboBox * | unitBox
DoubleSpinBox * | widthBox

## Additional Inherited Members

Protected Attributes inherited from ExtensibleFileDialog
QPushButton * | d_extension_toggle
| Button for toggling display of extension on/off. More...

## Detailed Description

QFileDialog extended with options for image export.

## Constructor & Destructor Documentation

## ImageExportDialog()

ImageExportDialog::ImageExportDialog | ( | MdiSubWindow * | window,
|  | QWidget * | parent = `0`,
|  | bool | extended = `true`,
|  | Graph * | g = `0`,
|  | Qt::WFlags | flags = `0`
| ) |  |

Constructor.

Parameters

  window | window to be exported
  parent | parent widget
  vector_options | whether advanced options are to be provided for export to vector formats
  extended | flag: show/hide the advanced options on start-up
  flags | window flags

References d_advanced_options, d_window, initAdvancedOptions(), ExtensibleFileDialog::setExtensionWidget(), and updateAdvancedOptions().

## Member Function Documentation

## accept

void ImageExportDialog::accept | ( |  | ) |

slot

References ApplicationWindow::d_confirm_overwrite.

Referenced by sizeUnit().

## adjustHeight

void ImageExportDialog::adjustHeight | ( | double | width | ) |

protected slot

References aspect_ratio, heightBox, keepRatioBox, DoubleSpinBox::setValue(), and unitBox.

Referenced by initAdvancedOptions(), and sizeUnit().

## adjustWidth

void ImageExportDialog::adjustWidth | ( | double | height | ) |

protected slot

References aspect_ratio, keepRatioBox, DoubleSpinBox::setValue(), unitBox, and widthBox.

Referenced by initAdvancedOptions(), and sizeUnit().

## bitmapResolution()

int ImageExportDialog::bitmapResolution | ( |  | ) | const

inline

For raster formats: returns the output resolution the user selected, defaulting to the screen resolution.

Referenced by drawPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and ApplicationWindow::exportMatrix().

## closeEvent

void ImageExportDialog::closeEvent | ( | QCloseEvent * | e | ) |

protected slot

References compression(), customExportSize(), d_3D_export_sort, ApplicationWindow::d_3D_export_sort, ApplicationWindow::d_3D_export_text_mode, d_3D_text_export_mode, d_bitmap_resolution, d_color, d_escape_tex_strings, ApplicationWindow::d_export_bitmap_resolution, ApplicationWindow::d_export_color, ApplicationWindow::d_export_compression, ApplicationWindow::d_export_escape_tex_strings, ApplicationWindow::d_export_quality, ApplicationWindow::d_export_raster_size, ApplicationWindow::d_export_size_unit, ApplicationWindow::d_export_tex_font_sizes, ApplicationWindow::d_export_transparency, ApplicationWindow::d_export_vector_resolution, ApplicationWindow::d_extended_export_dialog, ApplicationWindow::d_image_export_filter, ApplicationWindow::d_keep_aspect_ration, d_quality, ApplicationWindow::d_scale_fonts_factor, d_tex_font_sizes, d_transparency, d_vector_resolution, ExtensibleFileDialog::isExtended(), keepRatioBox, scaleFontsBox, unitBox, and DoubleSpinBox::value().

Referenced by sizeUnit().

## color()

bool ImageExportDialog::color | ( |  | ) | const

inline

For vector formats: returns whether colors should be enabled for ouput (default: true).

Referenced by drawVectorPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and ApplicationWindow::exportMatrix().

## compression()

int ImageExportDialog::compression | ( |  | ) | const

inline

For raster formats supporting this option returns the output image compression, 0 means no compression.

Referenced by closeEvent(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and ApplicationWindow::exportMatrix().

## customExportSize()

QSizeF ImageExportDialog::customExportSize | ( |  | ) |

Return the custom export size.

References d_custom_size_box, heightBox, DoubleSpinBox::value(), and widthBox.

Referenced by closeEvent(), drawPreview(), drawVectorPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and sortMode().

## drawPreview

void ImageExportDialog::drawPreview | ( | QPrinter * | printer | ) |

protected slot

References bitmapResolution(), MultiLayer::canvas(), customExportSize(), Graph::customPrintSize(), d_layer, d_window, MultiLayer::draw(), Graph::draw(), scaleFontsFactor(), and sizeUnit().

Referenced by preview(), and sizeUnit().

## drawVectorPreview

void ImageExportDialog::drawVectorPreview | ( | QPrinter * | printer | ) |

protected slot

References MultiLayer::canvas(), color(), customExportSize(), Graph::customPrintSize(), d_layer, d_window, MultiLayer::exportVector(), Graph::exportVector(), scaleFontsFactor(), sizeUnit(), and vectorResolution().

Referenced by preview(), and sizeUnit().

## escapeStrings()

bool ImageExportDialog::escapeStrings | ( |  | ) |

inline

For TeX format: returns whether special characters should be escaped for ouput (default: true).

Referenced by ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), and ApplicationWindow::exportLayer().

## exportFontSizes()

bool ImageExportDialog::exportFontSizes | ( |  | ) |

inline

For TeX format: returns whether font sizes should be exported (default: true).

Referenced by ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), and ApplicationWindow::exportLayer().

## initAdvancedOptions()

void ImageExportDialog::initAdvancedOptions | ( |  | ) |

private

Create d_advanced_options and everything it contains.

References adjustHeight(), adjustWidth(), aspect_ratio, MultiLayer::canvas(), compressionLabel, d_3D_export_sort, ApplicationWindow::d_3D_export_sort, ApplicationWindow::d_3D_export_text_mode, d_3D_text_export_mode, d_advanced_options, d_bitmap_resolution, d_color, d_compression, d_custom_size_box, d_escape_tex_strings, ApplicationWindow::d_export_bitmap_resolution, ApplicationWindow::d_export_color, ApplicationWindow::d_export_compression, ApplicationWindow::d_export_escape_tex_strings, ApplicationWindow::d_export_quality, ApplicationWindow::d_export_raster_size, ApplicationWindow::d_export_size_unit, ApplicationWindow::d_export_tex_font_sizes, ApplicationWindow::d_export_transparency, ApplicationWindow::d_export_vector_resolution, ApplicationWindow::d_keep_aspect_ration, d_layer, d_preview_button, d_quality, d_raster_options, ApplicationWindow::d_scale_fonts_factor, d_tex_font_sizes, d_transparency, d_vector_options, d_vector_resolution, d_window, heightBox, keepRatioBox, preview(), resolutionLabel, scaleFontsBox, DoubleSpinBox::setDecimals(), DoubleSpinBox::setFormat(), DoubleSpinBox::setMinimum(), DoubleSpinBox::setValue(), unitBox, and widthBox.

Referenced by ImageExportDialog().

## preview

void ImageExportDialog::preview | ( |  | ) |

protected slot

References d_raster_options, d_window, drawPreview(), and drawVectorPreview().

Referenced by initAdvancedOptions(), and sizeUnit().

## quality()

int ImageExportDialog::quality | ( |  | ) | const

inline

Return the quality (in percent) the user selected for export to raster formats.

References transparency().

Referenced by ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and ApplicationWindow::exportMatrix().

## scaleFontsFactor()

double ImageExportDialog::scaleFontsFactor | ( |  | ) |

Return the scale fonts factor.

References d_custom_size_box, scaleFontsBox, and DoubleSpinBox::value().

Referenced by drawPreview(), drawVectorPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and sizeUnit().

## selectFilter()

void ImageExportDialog::selectFilter | ( | const QString & | filter | ) |

References updateAdvancedOptions().

Referenced by ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), ApplicationWindow::exportMatrix(), and sortMode().

## sizeUnit()

int ImageExportDialog::sizeUnit | ( |  | ) |

inline

Return the unit used for the custom export size.

References accept(), adjustHeight(), adjustWidth(), closeEvent(), drawPreview(), drawVectorPreview(), preview(), scaleFontsFactor(), and updateAdvancedOptions().

Referenced by drawPreview(), drawVectorPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), and ApplicationWindow::exportLayer().

## sortMode()

int ImageExportDialog::sortMode | ( |  | ) | const

inline

Return the sort export mode for 3D plots.

References customExportSize(), and selectFilter().

Referenced by ApplicationWindow::exportAllGraphs(), and ApplicationWindow::exportGraph().

## textExportMode()

int ImageExportDialog::textExportMode | ( |  | ) | const

inline

Return the text export mode for 3D plots.

Referenced by ApplicationWindow::exportAllGraphs(), and ApplicationWindow::exportGraph().

## transparency()

bool ImageExportDialog::transparency | ( |  | ) | const

Return whether the output's background should be transparent.

References d_transparency.

Referenced by ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and quality().

## updateAdvancedOptions

void ImageExportDialog::updateAdvancedOptions | ( | const QString & | filter | ) |

protected slot

Update which options are visible and enabled based on the output format.

References compressionLabel, d_compression, d_custom_size_box, d_escape_tex_strings, ExtensibleFileDialog::d_extension_toggle, d_preview_button, d_raster_options, d_tex_font_sizes, d_transparency, d_vector_options, d_vector_resolution, d_window, and resolutionLabel.

Referenced by ImageExportDialog(), selectFilter(), and sizeUnit().

## vectorResolution()

int ImageExportDialog::vectorResolution | ( |  | ) | const

inline

For vector formats: returns the output resolution the user selected, defaulting to the screen resolution.

Referenced by drawVectorPreview(), ApplicationWindow::exportAllGraphs(), ApplicationWindow::exportGraph(), ApplicationWindow::exportLayer(), and ApplicationWindow::exportMatrix().

## Member Data Documentation

## aspect_ratio

double ImageExportDialog::aspect_ratio

private

Referenced by adjustHeight(), adjustWidth(), and initAdvancedOptions().

## compressionLabel

QLabel * ImageExportDialog::compressionLabel

private

Referenced by initAdvancedOptions(), and updateAdvancedOptions().

## d_3D_export_sort

QComboBox* ImageExportDialog::d_3D_export_sort

private

Referenced by closeEvent(), and initAdvancedOptions().

## d_3D_text_export_mode

QComboBox* ImageExportDialog::d_3D_text_export_mode

private

Referenced by closeEvent(), and initAdvancedOptions().

## d_advanced_options

QWidget* ImageExportDialog::d_advanced_options

private

Container widget for all advanced options.

Referenced by ImageExportDialog(), and initAdvancedOptions().

## d_bitmap_resolution

QSpinBox* ImageExportDialog::d_bitmap_resolution

private

Referenced by closeEvent(), and initAdvancedOptions().

## d_color

QCheckBox* ImageExportDialog::d_color

private

Referenced by closeEvent(), and initAdvancedOptions().

## d_compression

QComboBox* ImageExportDialog::d_compression

private

Referenced by initAdvancedOptions(), and updateAdvancedOptions().

## d_custom_size_box

QGroupBox* ImageExportDialog::d_custom_size_box

private

Container widget for user defined export size.

Referenced by customExportSize(), initAdvancedOptions(), scaleFontsFactor(), and updateAdvancedOptions().

## d_escape_tex_strings

QCheckBox* ImageExportDialog::d_escape_tex_strings

private

Referenced by closeEvent(), initAdvancedOptions(), and updateAdvancedOptions().

## d_layer

Graph* ImageExportDialog::d_layer

private

Referenced by drawPreview(), drawVectorPreview(), and initAdvancedOptions().

## d_preview_button

QPushButton* ImageExportDialog::d_preview_button

private

Referenced by initAdvancedOptions(), and updateAdvancedOptions().

## d_quality

QSpinBox* ImageExportDialog::d_quality

private

Referenced by closeEvent(), and initAdvancedOptions().

## d_raster_options

QGroupBox* ImageExportDialog::d_raster_options

private

Container widget for all options available for raster formats.

Referenced by initAdvancedOptions(), preview(), and updateAdvancedOptions().

## d_tex_font_sizes

QCheckBox* ImageExportDialog::d_tex_font_sizes

private

Referenced by closeEvent(), initAdvancedOptions(), and updateAdvancedOptions().

## d_transparency

QCheckBox* ImageExportDialog::d_transparency

private

Referenced by closeEvent(), initAdvancedOptions(), transparency(), and updateAdvancedOptions().

## d_vector_options

QGroupBox* ImageExportDialog::d_vector_options

private

Container widget for all options available for vector formats.

Referenced by initAdvancedOptions(), and updateAdvancedOptions().

## d_vector_resolution

QSpinBox* ImageExportDialog::d_vector_resolution

private

Referenced by closeEvent(), initAdvancedOptions(), and updateAdvancedOptions().

## d_window

MdiSubWindow* ImageExportDialog::d_window

private

Pointer to the window to be exported.

Referenced by drawPreview(), drawVectorPreview(), ImageExportDialog(), initAdvancedOptions(), preview(), and updateAdvancedOptions().

## heightBox

DoubleSpinBox * ImageExportDialog::heightBox

private

Referenced by adjustHeight(), customExportSize(), and initAdvancedOptions().

## keepRatioBox

QCheckBox* ImageExportDialog::keepRatioBox

private

Referenced by adjustHeight(), adjustWidth(), closeEvent(), and initAdvancedOptions().

## resolutionLabel

QLabel* ImageExportDialog::resolutionLabel

private

Referenced by initAdvancedOptions(), and updateAdvancedOptions().

## scaleFontsBox

DoubleSpinBox * ImageExportDialog::scaleFontsBox

private

Referenced by closeEvent(), initAdvancedOptions(), and scaleFontsFactor().

## unitBox

QComboBox* ImageExportDialog::unitBox

private

Referenced by adjustHeight(), adjustWidth(), closeEvent(), and initAdvancedOptions().

## widthBox

DoubleSpinBox* ImageExportDialog::widthBox

private

Referenced by adjustWidth(), customExportSize(), and initAdvancedOptions().

The documentation for this class was generated from the following files:

- qtiplot/src/plot2D/dialogs/ImageExportDialog.h
- qtiplot/src/plot2D/dialogs/ImageExportDialog.cpp