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

The ProjectPrintWindow class Windows used to configure and view diagram before print. More...

#include <projectprintwindow.h>

Inherits QMainWindow.

Collaboration diagram for ProjectPrintWindow:
Collaboration graph

Public Member Functions

 ProjectPrintWindow (QETProject *project, QPrinter *printer, QWidget *parent=nullptr)
 ProjectPrintWindow::ProjectPrintWindow Constructor, don't use this class directly, instead use ProjectPrintWindow::launchDialog static function.
 
 ~ProjectPrintWindow ()
 ProjectPrintWindow::~ProjectPrintWindow.
 

Static Public Member Functions

static void launchDialog (QETProject *project, QPrinter::OutputFormat format=QPrinter::NativeFormat, QWidget *parent=nullptr)
 ProjectPrintWindow::ProjectPrintWindow Use this static function to properly launch the print dialog.
 
static QString docName (QETProject *project)
 

Private Slots

void on_m_draw_border_cb_clicked ()
 
void on_m_draw_titleblock_cb_clicked ()
 
void on_m_keep_conductor_color_cb_clicked ()
 
void on_m_draw_terminal_cb_clicked ()
 
void on_m_fit_in_page_cb_clicked ()
 
void on_m_use_full_page_cb_clicked ()
 
void on_m_zoom_out_action_triggered ()
 
void on_m_zoom_in_action_triggered ()
 
void on_m_adjust_width_action_triggered ()
 
void on_m_adjust_page_action_triggered ()
 
void on_m_landscape_action_triggered ()
 
void on_m_portrait_action_triggered ()
 
void on_m_first_page_action_triggered ()
 
void on_m_previous_page_action_triggered ()
 
void on_m_next_page_action_triggered ()
 
void on_m_last_page_action_triggered ()
 
void on_m_display_single_page_action_triggered ()
 
void on_m_display_two_page_action_triggered ()
 
void on_m_display_all_page_action_triggered ()
 
void on_m_page_setup_triggered ()
 
void on_m_check_all_pb_clicked ()
 
void on_m_uncheck_all_clicked ()
 
void print ()
 
void on_m_date_cb_userDateChanged (const QDate &date)
 
void on_m_date_from_cb_currentIndexChanged (int index)
 
void on_m_apply_date_pb_clicked ()
 

Private Member Functions

void requestPaint ()
 ProjectPrintWindow::requestPaint.
 
void printDiagram (Diagram *diagram, bool fit_page, QPainter *painter, QPrinter *printer)
 ProjectPrintWindow::printDiagram Print @diagram on the @printer.
 
QRect diagramRect (Diagram *diagram, const ExportProperties &option) const
 ProjectPrintWindow::diagramRect.
 
int horizontalPagesCount (Diagram *diagram, const ExportProperties &option, bool full_page) const
 ProjectPrintWindow::horizontalPagesCount.
 
int verticalPagesCount (Diagram *diagram, const ExportProperties &option, bool full_page) const
 ProjectPrintWindow::verticalPagesCount.
 
ExportProperties exportProperties () const
 
void setUpDiagramList ()
 
QString settingsSectionName (const QPrinter *printer)
 
void loadPageSetupForCurrentPrinter ()
 
void savePageSetupForCurrentPrinter ()
 
void saveReloadDiagramParameters (Diagram *diagram, const ExportProperties &options, bool save)
 ProjectPrintWindow::saveReloadDiagramParameters Save or restore the parameter of @diagram.
 
QList< Diagram * > selectedDiagram () const
 
void exportToPDF ()
 

Private Attributes

Ui::ProjectPrintWindow * ui
 
QETProjectm_project = nullptr
 
QPrinter * m_printer = nullptr
 
QPrintPreviewWidget * m_preview =nullptr
 
QColor m_backup_diagram_background_color
 
QHash< Diagram *, QCheckBox * > m_diagram_list_hash
 

Detailed Description

The ProjectPrintWindow class Windows used to configure and view diagram before print.

Constructor & Destructor Documentation

◆ ProjectPrintWindow()

ProjectPrintWindow::ProjectPrintWindow ( QETProject project,
QPrinter *  printer,
QWidget *  parent = nullptr 
)
explicit

ProjectPrintWindow::ProjectPrintWindow Constructor, don't use this class directly, instead use ProjectPrintWindow::launchDialog static function.

Parameters
project
printer: QPrinter to use. Note that ProjectPrintWindow take ownerchip of @printer
parent
Here is the call graph for this function:

◆ ~ProjectPrintWindow()

ProjectPrintWindow::~ProjectPrintWindow ( )

Member Function Documentation

◆ diagramRect()

QRect ProjectPrintWindow::diagramRect ( Diagram diagram,
const ExportProperties option 
) const
private

ProjectPrintWindow::diagramRect.

Parameters
diagram
option
Returns
The rectangle of diagram to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ docName()

QString ProjectPrintWindow::docName ( QETProject project)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportProperties()

ExportProperties ProjectPrintWindow::exportProperties ( ) const
private
Here is the caller graph for this function:

◆ exportToPDF()

void ProjectPrintWindow::exportToPDF ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ horizontalPagesCount()

int ProjectPrintWindow::horizontalPagesCount ( Diagram diagram,
const ExportProperties option,
bool  full_page 
) const
private

ProjectPrintWindow::horizontalPagesCount.

Parameters
diagram: diagram to print
option: option used to render
full_page: full page or not
Returns
The width of the "poster" in number of page for print the diagram with the orientation and the paper format used by the actual printer
Here is the call graph for this function:
Here is the caller graph for this function:

◆ launchDialog()

void ProjectPrintWindow::launchDialog ( QETProject project,
QPrinter::OutputFormat  format = QPrinter::NativeFormat,
QWidget *  parent = nullptr 
)
static

ProjectPrintWindow::ProjectPrintWindow Use this static function to properly launch the print dialog.

Parameters
project: project to print
format: native format to print in physical printer, or pdf format to export in pdf
parent: parent widget
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPageSetupForCurrentPrinter()

void ProjectPrintWindow::loadPageSetupForCurrentPrinter ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_adjust_page_action_triggered

void ProjectPrintWindow::on_m_adjust_page_action_triggered ( )
privateslot

◆ on_m_adjust_width_action_triggered

void ProjectPrintWindow::on_m_adjust_width_action_triggered ( )
privateslot

◆ on_m_apply_date_pb_clicked

void ProjectPrintWindow::on_m_apply_date_pb_clicked ( )
privateslot
Here is the call graph for this function:

◆ on_m_check_all_pb_clicked

void ProjectPrintWindow::on_m_check_all_pb_clicked ( )
privateslot
Here is the caller graph for this function:

◆ on_m_date_cb_userDateChanged

void ProjectPrintWindow::on_m_date_cb_userDateChanged ( const QDate &  date)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_date_from_cb_currentIndexChanged

void ProjectPrintWindow::on_m_date_from_cb_currentIndexChanged ( int  index)
privateslot
Here is the call graph for this function:

◆ on_m_display_all_page_action_triggered

void ProjectPrintWindow::on_m_display_all_page_action_triggered ( )
privateslot

◆ on_m_display_single_page_action_triggered

void ProjectPrintWindow::on_m_display_single_page_action_triggered ( )
privateslot

◆ on_m_display_two_page_action_triggered

void ProjectPrintWindow::on_m_display_two_page_action_triggered ( )
privateslot

◆ on_m_draw_border_cb_clicked

void ProjectPrintWindow::on_m_draw_border_cb_clicked ( )
privateslot

◆ on_m_draw_terminal_cb_clicked

void ProjectPrintWindow::on_m_draw_terminal_cb_clicked ( )
privateslot

◆ on_m_draw_titleblock_cb_clicked

void ProjectPrintWindow::on_m_draw_titleblock_cb_clicked ( )
privateslot

◆ on_m_first_page_action_triggered

void ProjectPrintWindow::on_m_first_page_action_triggered ( )
privateslot

◆ on_m_fit_in_page_cb_clicked

void ProjectPrintWindow::on_m_fit_in_page_cb_clicked ( )
privateslot

◆ on_m_keep_conductor_color_cb_clicked

void ProjectPrintWindow::on_m_keep_conductor_color_cb_clicked ( )
privateslot

◆ on_m_landscape_action_triggered

void ProjectPrintWindow::on_m_landscape_action_triggered ( )
privateslot

◆ on_m_last_page_action_triggered

void ProjectPrintWindow::on_m_last_page_action_triggered ( )
privateslot

◆ on_m_next_page_action_triggered

void ProjectPrintWindow::on_m_next_page_action_triggered ( )
privateslot

◆ on_m_page_setup_triggered

void ProjectPrintWindow::on_m_page_setup_triggered ( )
privateslot

◆ on_m_portrait_action_triggered

void ProjectPrintWindow::on_m_portrait_action_triggered ( )
privateslot

◆ on_m_previous_page_action_triggered

void ProjectPrintWindow::on_m_previous_page_action_triggered ( )
privateslot

◆ on_m_uncheck_all_clicked

void ProjectPrintWindow::on_m_uncheck_all_clicked ( )
privateslot
Here is the caller graph for this function:

◆ on_m_use_full_page_cb_clicked

void ProjectPrintWindow::on_m_use_full_page_cb_clicked ( )
privateslot

◆ on_m_zoom_in_action_triggered

void ProjectPrintWindow::on_m_zoom_in_action_triggered ( )
privateslot

◆ on_m_zoom_out_action_triggered

void ProjectPrintWindow::on_m_zoom_out_action_triggered ( )
privateslot

◆ print

void ProjectPrintWindow::print ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printDiagram()

void ProjectPrintWindow::printDiagram ( Diagram diagram,
bool  fit_page,
QPainter *  painter,
QPrinter *  printer 
)
private

ProjectPrintWindow::printDiagram Print @diagram on the @printer.

Parameters
diagram
fit_page
printer
Here is the call graph for this function:
Here is the caller graph for this function:

◆ requestPaint()

void ProjectPrintWindow::requestPaint ( )
private

ProjectPrintWindow::requestPaint.

Parameters
slotcalled when m_preview emit paintRequested
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePageSetupForCurrentPrinter()

void ProjectPrintWindow::savePageSetupForCurrentPrinter ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveReloadDiagramParameters()

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

ProjectPrintWindow::saveReloadDiagramParameters Save or restore the parameter of @diagram.

Parameters
diagram
options
save
Here is the caller graph for this function:

◆ selectedDiagram()

QList< Diagram * > ProjectPrintWindow::selectedDiagram ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settingsSectionName()

QString ProjectPrintWindow::settingsSectionName ( const QPrinter *  printer)
private
Here is the caller graph for this function:

◆ setUpDiagramList()

void ProjectPrintWindow::setUpDiagramList ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ verticalPagesCount()

int ProjectPrintWindow::verticalPagesCount ( Diagram diagram,
const ExportProperties option,
bool  full_page 
) const
private

ProjectPrintWindow::verticalPagesCount.

Parameters
diagram: diagram to print
option: option used to render
full_page: full page or not
Returns
The height of the "poster" in number of pages for print the diagram with the orientation and paper format used by the actual printer
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_backup_diagram_background_color

QColor ProjectPrintWindow::m_backup_diagram_background_color
private

◆ m_diagram_list_hash

QHash<Diagram *, QCheckBox *> ProjectPrintWindow::m_diagram_list_hash
private

◆ m_preview

QPrintPreviewWidget* ProjectPrintWindow::m_preview =nullptr
private

◆ m_printer

QPrinter* ProjectPrintWindow::m_printer = nullptr
private

◆ m_project

QETProject* ProjectPrintWindow::m_project = nullptr
private

◆ ui

Ui::ProjectPrintWindow* ProjectPrintWindow::ui
private

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