QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Classes | Public Slots | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ExportDialog Class Reference

#include <exportdialog.h>

Inherits QDialog.

Collaboration diagram for ExportDialog:
Collaboration graph

Classes

class  ExportDiagramLine
 

Public Slots

void slot_correctWidth (int)
 
void slot_correctHeight (int)
 
void slot_keepRatioChanged (int)
 
void slot_resetSize (int)
 
void slot_export ()
 
void slot_changeUseBorder ()
 
void slot_checkDiagramsCount ()
 
void slot_changeFilesExtension (bool=false)
 
void slot_previewDiagram (int)
 
void slot_exportToClipBoard (int)
 
void slot_selectAllClicked ()
 
void slot_deSelectAllClicked ()
 

Public Member Functions

 ExportDialog (QETProject *, QWidget *=nullptr)
 
 ~ExportDialog () override
 
int diagramsToExportCount () const
 

Static Public Member Functions

static QPointF rotation_transformed (qreal, qreal, qreal, qreal, qreal)
 

Private Member Functions

 ExportDialog (const ExportDialog &)
 
QWidget * initDiagramsListPart ()
 
void saveReloadDiagramParameters (Diagram *, bool=true)
 
void generateSvg (Diagram *, int, int, bool, QIODevice &)
 
void generateDxf (Diagram *, int, int, QString &)
 
QImage generateImage (Diagram *, int, int, bool)
 
void exportDiagram (ExportDiagramLine *)
 
qreal diagramRatio (Diagram *)
 
QSize diagramSize (Diagram *)
 

Private Attributes

QHash< int, ExportDialog::ExportDiagramLine * > diagram_lines_
 
QGridLayout * diagrams_list_layout_
 
ExportPropertiesWidgetepw
 
QDialogButtonBox * buttons
 
QPushButton * selectAll
 
QPushButton * deSelectAll
 
QSignalMapper * preview_mapper_
 
QSignalMapper * width_mapper_
 
QSignalMapper * height_mapper_
 
QSignalMapper * ratio_mapper_
 
QSignalMapper * reset_mapper_
 
QSignalMapper * clipboard_mapper_
 
QETProjectproject_
 

Detailed Description

This class provides a dialog enabling users to export 1 to n diagrams from a project as image files, with features like preview, copy to clipboard, resize, etc.

Constructor & Destructor Documentation

◆ ExportDialog() [1/2]

ExportDialog::ExportDialog ( QETProject project,
QWidget *  parent = nullptr 
)

Constructeur

Parameters
projectLe projet a exporter
parentLe Widget parent de ce dialogue
Here is the call graph for this function:

◆ ~ExportDialog()

ExportDialog::~ExportDialog ( )
override

Destructeur - ne fait rien

◆ ExportDialog() [2/2]

ExportDialog::ExportDialog ( const ExportDialog )
private

Member Function Documentation

◆ diagramRatio()

qreal ExportDialog::diagramRatio ( Diagram diagram)
private
Parameters
diagramUn schema
Returns
le rapport largeur / hauteur du schema
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diagramSize()

QSize ExportDialog::diagramSize ( Diagram diagram)
private
Parameters
diagramUn schema
Returns
les dimensions du schema, en tenant compte du type d'export : cadre ou elements
Here is the caller graph for this function:

◆ diagramsToExportCount()

int ExportDialog::diagramsToExportCount ( ) const
Returns
le nombre de schemas coches (donc a exporter)
Here is the caller graph for this function:

◆ exportDiagram()

void ExportDialog::exportDiagram ( ExportDiagramLine diagram_line)
private

Exporte un schema

Parameters
diagram_lineLa ligne decrivant le schema a exporter et la maniere de l'exporter
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateDxf()

void ExportDialog::generateDxf ( Diagram diagram,
int  width,
int  height,
QString &  file_path 
)
private

Exporte le schema en DXF

Parameters
diagramSchema a exporter en DXF
widthLargeur de l'export DXF
heightHauteur de l'export DXF
file_path
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateImage()

QImage ExportDialog::generateImage ( Diagram diagram,
int  width,
int  height,
bool  keep_aspect_ratio 
)
private

Genere l'image a exporter

Parameters
diagramSchema a exporter en SVG
widthLargeur de l'export
heightHauteur de l'export
keep_aspect_ratioTrue pour conserver le ratio, false sinon
Returns
l'image a exporter
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateSvg()

void ExportDialog::generateSvg ( Diagram diagram,
int  width,
int  height,
bool  keep_aspect_ratio,
QIODevice &  io_device 
)
private

Exporte le schema en SVG

Parameters
diagramSchema a exporter en SVG
widthLargeur de l'export SVG
heightHauteur de l'export SVG
keep_aspect_ratioTrue pour conserver le ratio, false sinon
io_devicePeripherique de sortie pour le code SVG (souvent : un fichier)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initDiagramsListPart()

QWidget * ExportDialog::initDiagramsListPart ( )
private

Met en place la liste des schemas

Returns
Le widget representant la liste des schemas
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotation_transformed()

QPointF ExportDialog::rotation_transformed ( qreal  px,
qreal  py,
qreal  origin_x,
qreal  origin_y,
qreal  angle 
)
static
Here is the caller graph for this function:

◆ saveReloadDiagramParameters()

void ExportDialog::saveReloadDiagramParameters ( Diagram diagram,
bool  save = true 
)
private

Sauve ou restaure les parametres du schema

Parameters
diagramSchema dont on sauve ou restaure les parametres
savetrue pour memoriser les parametres du schema et appliquer ceux definis par le formulaire, false pour restaurer les parametres
Here is the caller graph for this function:

◆ slot_changeFilesExtension

void ExportDialog::slot_changeFilesExtension ( bool  force_extension = false)
slot

Modifie les extensions des fichiers en fonction du format selectionne

Parameters
force_extensiontrue pour ajouter l'extension si elle n'est pas presente, false pour se contenter de la modifier si elle est incorrecte.
Here is the caller graph for this function:

◆ slot_changeUseBorder

void ExportDialog::slot_changeUseBorder ( )
slot

Slot appele lorsque l'utilisateur change la zone du schema qui doit etre exportee. Il faut alors ajuster les dimensions des schemas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_checkDiagramsCount

void ExportDialog::slot_checkDiagramsCount ( )
slot

Ce slot est appele quand un schema a ete coche ou decoche. Il active ou desactive le bouton "Exporter" en fonction du nombre de schemas coches, et il garde au plus un schema coche si on exporte vers le presse-papier.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_correctHeight

void ExportDialog::slot_correctHeight ( int  diagram_id)
slot

Cette methode ajuste la hauteur d'un des schemas a exporter en fonction de sa largeur si et seulement si l'option "Conserver les proportions" est activee pour ce schema.

Parameters
diagram_idnumero du schema concerne
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_correctWidth

void ExportDialog::slot_correctWidth ( int  diagram_id)
slot

Cette methode ajuste la largeur d'un des schemas a exporter en fonction de sa hauteur si et seulement si l'option "Conserver les proportions" est activee pour ce schema.

Parameters
diagram_idnumero du schema concerne
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_deSelectAllClicked

void ExportDialog::slot_deSelectAllClicked ( )
slot
Here is the caller graph for this function:

◆ slot_export

void ExportDialog::slot_export ( )
slot

Slot effectuant les exports apres la validation du dialogue.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_exportToClipBoard

void ExportDialog::slot_exportToClipBoard ( int  diagram_id)
slot

Cette methode exporte un schema vers le presse-papier

Parameters
diagram_idnumero du schema a previsualiser
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_keepRatioChanged

void ExportDialog::slot_keepRatioChanged ( int  diagram_id)
slot

Prend en compte le fait qu'il faut desormais conserver ou non les proportions d'un des schemas

Parameters
diagram_idnumero du schema concerne
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_previewDiagram

void ExportDialog::slot_previewDiagram ( int  diagram_id)
slot

Cette methode fait apparaitre un dialogue permettant de previsualiser un des schemas a exporter

Parameters
diagram_idnumero du schema a previsualiser
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_resetSize

void ExportDialog::slot_resetSize ( int  diagram_id)
slot

Reinitialise les dimensions d'un des schemas

Parameters
diagram_idnumero du schema concerne
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slot_selectAllClicked

void ExportDialog::slot_selectAllClicked ( )
slot
Here is the caller graph for this function:

Member Data Documentation

◆ buttons

QDialogButtonBox* ExportDialog::buttons
private

◆ clipboard_mapper_

QSignalMapper* ExportDialog::clipboard_mapper_
private

◆ deSelectAll

QPushButton* ExportDialog::deSelectAll
private

◆ diagram_lines_

QHash<int, ExportDialog::ExportDiagramLine *> ExportDialog::diagram_lines_
private

◆ diagrams_list_layout_

QGridLayout* ExportDialog::diagrams_list_layout_
private

◆ epw

ExportPropertiesWidget* ExportDialog::epw
private

◆ height_mapper_

QSignalMapper* ExportDialog::height_mapper_
private

◆ preview_mapper_

QSignalMapper* ExportDialog::preview_mapper_
private

◆ project_

QETProject* ExportDialog::project_
private

◆ ratio_mapper_

QSignalMapper* ExportDialog::ratio_mapper_
private

◆ reset_mapper_

QSignalMapper* ExportDialog::reset_mapper_
private

◆ selectAll

QPushButton* ExportDialog::selectAll
private

◆ width_mapper_

QSignalMapper* ExportDialog::width_mapper_
private

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