QElectroTech  0.8-dev
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
DiagramPrintDialog Class Reference

The DiagramPrintDialog class This class implements both the dialog allowing users to configure the printing of a project file and the printing itself. More...

#include <diagramprintdialog.h>

Inherits QWidget.

Collaboration diagram for DiagramPrintDialog:
Collaboration graph

Public Member Functions

 DiagramPrintDialog (QETProject *, QWidget *=nullptr)
 
 ~DiagramPrintDialog () override
 
void setFileName (const QString &)
 
QString fileName () const
 
void setDocName (const QString &)
 
QString docName () const
 
QRect diagramRect (Diagram *, const ExportProperties &) const
 DiagramPrintDialog::diagramRect. More...
 
int pagesCount (Diagram *, const ExportProperties &, bool=false) const
 
int horizontalPagesCount (Diagram *, const ExportProperties &, bool=false) const
 
int verticalPagesCount (Diagram *, const ExportProperties &, bool=false) const
 
void exec ()
 

Private Slots

void print (const QList< Diagram * > &, bool, const ExportProperties &)
 
void printDiagram (Diagram *, bool, const ExportProperties &, QPainter *, QPrinter *=nullptr)
 
void updatePrintTypeDialog ()
 
void acceptPrintTypeDialog ()
 
void browseFilePrintTypeDialog ()
 

Private Member Functions

 DiagramPrintDialog (const DiagramPrintDialog &)
 
void buildPrintTypeDialog ()
 
void buildDialog ()
 
void saveReloadDiagramParameters (Diagram *, const ExportProperties &, bool)
 
void savePageSetupForCurrentPrinter ()
 
void loadPageSetupForCurrentPrinter ()
 
QString settingsSectionName (const QPrinter *)
 

Private Attributes

QETProjectproject_
 
QPrinter * printer_
 
QString doc_name_
 
QString file_name_
 
QDialog * dialog_
 
QLabel * printtype_label_
 
QGridLayout * glayout0_
 
QVBoxLayout * vlayout0_
 
QHBoxLayout * hlayout0_
 
QLabel * printer_icon_
 
QLabel * pdf_icon_
 
QButtonGroup * printtype_choice_
 
QRadioButton * printer_choice_
 
QRadioButton * pdf_choice_
 
QLineEdit * filepath_field_
 
QPushButton * browse_button_
 
QDialogButtonBox * buttons_
 
QColor backup_diagram_background_color
 

Detailed Description

The DiagramPrintDialog class This class implements both the dialog allowing users to configure the printing of a project file and the printing itself.

Constructor & Destructor Documentation

◆ DiagramPrintDialog() [1/2]

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

Constructeur

Parameters
projectSchema a imprimer
parentWidget parent du dialogue

◆ ~DiagramPrintDialog()

DiagramPrintDialog::~DiagramPrintDialog ( )
override

Destructeur

◆ DiagramPrintDialog() [2/2]

DiagramPrintDialog::DiagramPrintDialog ( const DiagramPrintDialog )
private

Member Function Documentation

◆ acceptPrintTypeDialog

void DiagramPrintDialog::acceptPrintTypeDialog ( )
privateslot

Verifie l'etat du dialogue permettant le choix du type d'impression lorsque l'utilisateur le valide.

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

◆ browseFilePrintTypeDialog

void DiagramPrintDialog::browseFilePrintTypeDialog ( )
privateslot

Permet a l'utilisateur de choisir un fichier

Here is the caller graph for this function:

◆ buildDialog()

void DiagramPrintDialog::buildDialog ( )
private

◆ buildPrintTypeDialog()

void DiagramPrintDialog::buildPrintTypeDialog ( )
private

Construit un dialogue non standard pour demander a l'utilisateur quelle type d'impression il souhaite effectuer : PDF, PS ou imprimante physique

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

◆ diagramRect()

QRect DiagramPrintDialog::diagramRect ( Diagram diagram,
const ExportProperties options 
) const

DiagramPrintDialog::diagramRect.

Parameters
diagram: Diagram to be printed
options:
Returns
the rectangle to be printed
Here is the caller graph for this function:

◆ docName()

QString DiagramPrintDialog::docName ( ) const
Returns
le nom du document

◆ exec()

void DiagramPrintDialog::exec ( )

Execute le dialogue d'impression

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

◆ fileName()

QString DiagramPrintDialog::fileName ( ) const
Returns
le nom du PDF

◆ horizontalPagesCount()

int DiagramPrintDialog::horizontalPagesCount ( Diagram diagram,
const ExportProperties options,
bool  fullpage = false 
) const
Parameters
diagramSchema a imprimer
optionsRendering options
fullpagetrue pour utiliser toute la feuille dans le calcul
Returns
La largeur du "poster" en nombre de pages pour imprimer le schema avec l'orientation et le format papier utilise dans l'imprimante en cours.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPageSetupForCurrentPrinter()

void DiagramPrintDialog::loadPageSetupForCurrentPrinter ( )
private

Load parameters previously set in the "page setup" dialog for the current printer, if any.

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

◆ pagesCount()

int DiagramPrintDialog::pagesCount ( Diagram diagram,
const ExportProperties options,
bool  fullpage = false 
) const
Parameters
diagramSchema a imprimer
optionsRendering options
fullpagetrue pour utiliser toute la feuille dans le calcul
Returns
Le nombre de pages necessaires pour imprimer le schema avec l'orientation et le format papier utilise dans l'imprimante en cours.
Here is the call graph for this function:

◆ print

void DiagramPrintDialog::print ( const QList< Diagram * > &  diagrams,
bool  fit_page,
const ExportProperties options 
)
privateslot

Effectue l'impression elle-meme

Parameters
diagramsSchemas a imprimer
fit_pageBooleen indiquant s'il faut adapter les schemas aux pages ou non
optionsOptions de rendu
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printDiagram

void DiagramPrintDialog::printDiagram ( Diagram diagram,
bool  fit_page,
const ExportProperties options,
QPainter *  qp,
QPrinter *  printer = nullptr 
)
privateslot

Imprime un schema

Parameters
diagramSchema a imprimer
fit_pageTrue pour adapter les schemas aux pages, false sinon
optionsOptions de rendu a appliquer pour l'impression
qpQPainter a utiliser (deja initialise sur printer)
printerImprimante a utiliser
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePageSetupForCurrentPrinter()

void DiagramPrintDialog::savePageSetupForCurrentPrinter ( )
private

Save parameters set in the "page setup" dialog into the QElectroTech configuration. Key/values pairs are associated to the printer for which they have been set.

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

◆ saveReloadDiagramParameters()

void DiagramPrintDialog::saveReloadDiagramParameters ( Diagram diagram,
const ExportProperties options,
bool  save 
)
private

Sauve ou restaure les parametres du schema

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

◆ setDocName()

void DiagramPrintDialog::setDocName ( const QString &  name)

Definit le nom du document

Here is the caller graph for this function:

◆ setFileName()

void DiagramPrintDialog::setFileName ( const QString &  name)

Definit le nom du PDF si l'utilisateur choisit une sortie vers un PDF

Here is the caller graph for this function:

◆ settingsSectionName()

QString DiagramPrintDialog::settingsSectionName ( const QPrinter *  printer)
private
Returns
a section name for use with QSettings in order to store parameters related to printer.
Here is the caller graph for this function:

◆ updatePrintTypeDialog

void DiagramPrintDialog::updatePrintTypeDialog ( )
privateslot

Assure la coherence du dialogue permettant le choix du type d'impression

Here is the caller graph for this function:

◆ verticalPagesCount()

int DiagramPrintDialog::verticalPagesCount ( Diagram diagram,
const ExportProperties options,
bool  fullpage = false 
) const
Parameters
diagramSchema a imprimer
optionsRendering options
fullpagetrue pour utiliser toute la feuille dans le calcul
Returns
La largeur du "poster" en nombre de pages pour imprimer le schema avec l'orientation et le format papier utilise dans l'imprimante en cours.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ backup_diagram_background_color

QColor DiagramPrintDialog::backup_diagram_background_color
private

◆ browse_button_

QPushButton* DiagramPrintDialog::browse_button_
private

◆ buttons_

QDialogButtonBox* DiagramPrintDialog::buttons_
private

◆ dialog_

QDialog* DiagramPrintDialog::dialog_
private

◆ doc_name_

QString DiagramPrintDialog::doc_name_
private

◆ file_name_

QString DiagramPrintDialog::file_name_
private

◆ filepath_field_

QLineEdit* DiagramPrintDialog::filepath_field_
private

◆ glayout0_

QGridLayout* DiagramPrintDialog::glayout0_
private

◆ hlayout0_

QHBoxLayout* DiagramPrintDialog::hlayout0_
private

◆ pdf_choice_

QRadioButton* DiagramPrintDialog::pdf_choice_
private

◆ pdf_icon_

QLabel* DiagramPrintDialog::pdf_icon_
private

◆ printer_

QPrinter* DiagramPrintDialog::printer_
private

◆ printer_choice_

QRadioButton* DiagramPrintDialog::printer_choice_
private

◆ printer_icon_

QLabel* DiagramPrintDialog::printer_icon_
private

◆ printtype_choice_

QButtonGroup* DiagramPrintDialog::printtype_choice_
private

◆ printtype_label_

QLabel* DiagramPrintDialog::printtype_label_
private

◆ project_

QETProject* DiagramPrintDialog::project_
private

◆ vlayout0_

QVBoxLayout* DiagramPrintDialog::vlayout0_
private

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