QElectroTech
0.70
|
#include <diagramprintdialog.h>
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 |
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 | |
QETProject * | project_ |
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 |
This class implements both the dialog allowing users to configure the printing of a project file and the printing itself.
Definition at line 32 of file diagramprintdialog.h.
DiagramPrintDialog::DiagramPrintDialog | ( | QETProject * | project, |
QWidget * | parent = nullptr |
||
) |
Constructeur
project | Schema a imprimer |
parent | Widget parent du dialogue |
Definition at line 34 of file diagramprintdialog.cpp.
References Diagram::background_color, backup_diagram_background_color, and printer_.
|
override |
Destructeur
Definition at line 51 of file diagramprintdialog.cpp.
References Diagram::background_color, backup_diagram_background_color, dialog_, and printer_.
|
private |
|
privateslot |
Verifie l'etat du dialogue permettant le choix du type d'impression lorsque l'utilisateur le valide.
Definition at line 303 of file diagramprintdialog.cpp.
References dialog_, filepath_field_, QET::QetMessageBox::information(), printer_choice_, and QET::Icons::tr.
Referenced by buildPrintTypeDialog().
|
privateslot |
Permet a l'utilisateur de choisir un fichier
Definition at line 324 of file diagramprintdialog.cpp.
References filepath_field_, pdf_choice_, printer_choice_, and QET::Icons::tr.
Referenced by buildPrintTypeDialog().
|
private |
|
private |
Construit un dialogue non standard pour demander a l'utilisateur quelle type d'impression il souhaite effectuer : PDF, PS ou imprimante physique
Definition at line 214 of file diagramprintdialog.cpp.
References acceptPrintTypeDialog(), browse_button_, browseFilePrintTypeDialog(), buttons_, QET::Icons::Cancel, dialog_, file_name_, filepath_field_, glayout0_, hlayout0_, QET::Icons::PDF, pdf_choice_, pdf_icon_, QET::Icons::Printer, printer_choice_, printer_icon_, printtype_choice_, printtype_label_, QET::Icons::tr, updatePrintTypeDialog(), and vlayout0_.
Referenced by exec().
QRect DiagramPrintDialog::diagramRect | ( | Diagram * | diagram, |
const ExportProperties & | options | ||
) | const |
diagram | Diagram to be printed |
include_titleblock | (Optional, defaults to true) Whether the diagram titleblock should be printed. |
Definition at line 91 of file diagramprintdialog.cpp.
References ExportProperties::draw_titleblock.
Referenced by horizontalPagesCount(), printDiagram(), and verticalPagesCount().
QString DiagramPrintDialog::docName | ( | ) | const |
Definition at line 81 of file diagramprintdialog.cpp.
References doc_name_.
void DiagramPrintDialog::exec | ( | ) |
Execute le dialogue d'impression
Definition at line 109 of file diagramprintdialog.cpp.
References buildPrintTypeDialog(), QETPrintPreviewDialog::diagramsChooser(), dialog_, QET::displayedVersion, doc_name_, QETPrintPreviewDialog::exportProperties(), filepath_field_, QETPrintPreviewDialog::fitDiagramsToPages(), loadPageSetupForCurrentPrinter(), print(), printer_, printer_choice_, project_, savePageSetupForCurrentPrinter(), setDocName(), and QET::Icons::tr.
Referenced by ProjectView::printProject().
QString DiagramPrintDialog::fileName | ( | ) | const |
int DiagramPrintDialog::horizontalPagesCount | ( | Diagram * | diagram, |
const ExportProperties & | options, | ||
bool | fullpage = false |
||
) | const |
diagram | Schema a imprimer |
options | Rendering options |
fullpage | true pour utiliser toute la feuille dans le calcul |
Definition at line 185 of file diagramprintdialog.cpp.
References diagramRect(), and printer_.
Referenced by pagesCount(), and printDiagram().
|
private |
Load parameters previously set in the "page setup" dialog for the current printer, if any.
Definition at line 572 of file diagramprintdialog.cpp.
References QET::Custom, printer_, and settingsSectionName().
Referenced by exec().
int DiagramPrintDialog::pagesCount | ( | Diagram * | diagram, |
const ExportProperties & | options, | ||
bool | fullpage = false |
||
) | const |
diagram | Schema a imprimer |
options | Rendering options |
fullpage | true pour utiliser toute la feuille dans le calcul |
Definition at line 174 of file diagramprintdialog.cpp.
References horizontalPagesCount(), and verticalPagesCount().
|
privateslot |
Effectue l'impression elle-meme
diagrams | Schemas a imprimer |
fit_page | Booleen indiquant s'il faut adapter les schemas aux pages ou non |
options | Options de rendu |
Definition at line 355 of file diagramprintdialog.cpp.
References printDiagram(), and printer_.
Referenced by exec().
|
privateslot |
Imprime un schema
diagram | Schema a imprimer |
fit_page | True pour adapter les schemas aux pages, false sinon |
options | Options de rendu a appliquer pour l'impression |
qp | QPainter a utiliser (deja initialise sur printer) |
printer | Imprimante a utiliser |
Definition at line 402 of file diagramprintdialog.cpp.
References diagramRect(), horizontalPagesCount(), saveReloadDiagramParameters(), and verticalPagesCount().
Referenced by print().
|
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.
Definition at line 536 of file diagramprintdialog.cpp.
References QET::Custom, printer_, and settingsSectionName().
Referenced by exec().
|
private |
Sauve ou restaure les parametres du schema
diagram | Schema dont on sauve ou restaure les parametres |
options | Parametres a appliquer |
save | true pour memoriser les parametres du schema et appliquer ceux definis dans options, false pour restaurer les parametres |
Definition at line 519 of file diagramprintdialog.cpp.
Referenced by printDiagram().
void DiagramPrintDialog::setDocName | ( | const QString & | name | ) |
Definit le nom du document
Definition at line 74 of file diagramprintdialog.cpp.
References doc_name_.
Referenced by exec(), and ProjectView::printProject().
void DiagramPrintDialog::setFileName | ( | const QString & | name | ) |
Definit le nom du PDF si l'utilisateur choisit une sortie vers un PDF
Definition at line 60 of file diagramprintdialog.cpp.
References file_name_.
Referenced by ProjectView::printProject().
|
private |
Definition at line 622 of file diagramprintdialog.cpp.
Referenced by loadPageSetupForCurrentPrinter(), and savePageSetupForCurrentPrinter().
|
privateslot |
Assure la coherence du dialogue permettant le choix du type d'impression
Definition at line 275 of file diagramprintdialog.cpp.
References browse_button_, filepath_field_, pdf_choice_, and printer_choice_.
Referenced by buildPrintTypeDialog().
int DiagramPrintDialog::verticalPagesCount | ( | Diagram * | diagram, |
const ExportProperties & | options, | ||
bool | fullpage = false |
||
) | const |
diagram | Schema a imprimer |
options | Rendering options |
fullpage | true pour utiliser toute la feuille dans le calcul |
Definition at line 201 of file diagramprintdialog.cpp.
References diagramRect(), and printer_.
Referenced by pagesCount(), and printDiagram().
|
private |
Definition at line 91 of file diagramprintdialog.h.
Referenced by DiagramPrintDialog(), and ~DiagramPrintDialog().
|
private |
Definition at line 89 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog(), and updatePrintTypeDialog().
|
private |
Definition at line 90 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 78 of file diagramprintdialog.h.
Referenced by acceptPrintTypeDialog(), buildPrintTypeDialog(), exec(), and ~DiagramPrintDialog().
|
private |
Definition at line 75 of file diagramprintdialog.h.
Referenced by docName(), exec(), and setDocName().
|
private |
Definition at line 76 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog(), fileName(), and setFileName().
|
private |
Definition at line 88 of file diagramprintdialog.h.
Referenced by acceptPrintTypeDialog(), browseFilePrintTypeDialog(), buildPrintTypeDialog(), exec(), and updatePrintTypeDialog().
|
private |
Definition at line 80 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 82 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 87 of file diagramprintdialog.h.
Referenced by browseFilePrintTypeDialog(), buildPrintTypeDialog(), and updatePrintTypeDialog().
|
private |
Definition at line 84 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 74 of file diagramprintdialog.h.
Referenced by DiagramPrintDialog(), exec(), horizontalPagesCount(), loadPageSetupForCurrentPrinter(), print(), savePageSetupForCurrentPrinter(), verticalPagesCount(), and ~DiagramPrintDialog().
|
private |
Definition at line 86 of file diagramprintdialog.h.
Referenced by acceptPrintTypeDialog(), browseFilePrintTypeDialog(), buildPrintTypeDialog(), exec(), and updatePrintTypeDialog().
|
private |
Definition at line 83 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 85 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 79 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().
|
private |
Definition at line 73 of file diagramprintdialog.h.
Referenced by exec().
|
private |
Definition at line 81 of file diagramprintdialog.h.
Referenced by buildPrintTypeDialog().