QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
projectprintwindow.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef PROJECTPRINTWINDOW_H
19#define PROJECTPRINTWINDOW_H
20
21#include "../exportproperties.h"
22
23#include <QMainWindow>
24#include <QPrinter>
25
26namespace Ui {
28}
29
30class QETProject;
31class QPrintPreviewWidget;
32class QPrinter;
34class Diagram;
35class QCheckBox;
36
41class ProjectPrintWindow : public QMainWindow
42{
43 Q_OBJECT
44
45 public:
46 static void launchDialog(QETProject *project, QPrinter::OutputFormat format = QPrinter::NativeFormat, QWidget *parent = nullptr);
47 static QString docName(QETProject *project);
48
49 explicit ProjectPrintWindow(QETProject *project, QPrinter *printer, QWidget *parent = nullptr);
51
52 private slots:
75 void print();
76 void on_m_date_cb_userDateChanged(const QDate &date);
79
80 private:
81 void requestPaint();
82 void printDiagram(Diagram *diagram, bool fit_page, QPainter *painter, QPrinter *printer);
83 QRect diagramRect(Diagram *diagram, const ExportProperties &option) const;
84 int horizontalPagesCount(Diagram *diagram, const ExportProperties &option, bool full_page) const;
85 int verticalPagesCount(Diagram *diagram, const ExportProperties &option, bool full_page) const;
87 void setUpDiagramList();
88 QString settingsSectionName(const QPrinter *printer);
91 void saveReloadDiagramParameters(Diagram *diagram, const ExportProperties &options, bool save);
92 QList<Diagram *> selectedDiagram() const;
93 void exportToPDF();
94
95
96 private:
97 Ui::ProjectPrintWindow *ui;
99 QPrinter *m_printer = nullptr;
100 QPrintPreviewWidget *m_preview=nullptr;
102 QHash<Diagram *, QCheckBox *> m_diagram_list_hash;
103};
104
105#endif // PROJECTPRINTWINDOW_H
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition exportproperties.h:27
The ProjectPrintWindow class Windows used to configure and view diagram before print.
Definition projectprintwindow.h:42
void on_m_uncheck_all_clicked()
Definition projectprintwindow.cpp:764
void on_m_use_full_page_cb_clicked()
Definition projectprintwindow.cpp:686
int verticalPagesCount(Diagram *diagram, const ExportProperties &option, bool full_page) const
ProjectPrintWindow::verticalPagesCount.
Definition projectprintwindow.cpp:386
void on_m_adjust_page_action_triggered()
Definition projectprintwindow.cpp:704
QRect diagramRect(Diagram *diagram, const ExportProperties &option) const
ProjectPrintWindow::diagramRect.
Definition projectprintwindow.cpp:335
void setUpDiagramList()
Definition projectprintwindow.cpp:419
void on_m_keep_conductor_color_cb_clicked()
Definition projectprintwindow.cpp:683
void on_m_zoom_out_action_triggered()
Definition projectprintwindow.cpp:692
QString settingsSectionName(const QPrinter *printer)
Definition projectprintwindow.cpp:446
static QString docName(QETProject *project)
Definition projectprintwindow.cpp:98
void on_m_draw_border_cb_clicked()
Definition projectprintwindow.cpp:681
QPrintPreviewWidget * m_preview
Definition projectprintwindow.h:100
void on_m_last_page_action_triggered()
Definition projectprintwindow.cpp:732
void on_m_adjust_width_action_triggered()
Definition projectprintwindow.cpp:700
void on_m_previous_page_action_triggered()
Definition projectprintwindow.cpp:720
void on_m_date_from_cb_currentIndexChanged(int index)
Definition projectprintwindow.cpp:801
void on_m_landscape_action_triggered()
Definition projectprintwindow.cpp:708
void on_m_display_single_page_action_triggered()
Definition projectprintwindow.cpp:736
void on_m_first_page_action_triggered()
Definition projectprintwindow.cpp:716
QColor m_backup_diagram_background_color
Definition projectprintwindow.h:101
void printDiagram(Diagram *diagram, bool fit_page, QPainter *painter, QPrinter *printer)
ProjectPrintWindow::printDiagram Print @diagram on the @printer.
Definition projectprintwindow.cpp:233
void saveReloadDiagramParameters(Diagram *diagram, const ExportProperties &options, bool save)
ProjectPrintWindow::saveReloadDiagramParameters Save or restore the parameter of @diagram.
Definition projectprintwindow.cpp:646
void on_m_draw_terminal_cb_clicked()
Definition projectprintwindow.cpp:684
void on_m_display_all_page_action_triggered()
Definition projectprintwindow.cpp:744
int horizontalPagesCount(Diagram *diagram, const ExportProperties &option, bool full_page) const
ProjectPrintWindow::horizontalPagesCount.
Definition projectprintwindow.cpp:357
void on_m_draw_titleblock_cb_clicked()
Definition projectprintwindow.cpp:682
ExportProperties exportProperties() const
Definition projectprintwindow.cpp:407
Ui::ProjectPrintWindow * ui
Definition projectprintwindow.h:97
QHash< Diagram *, QCheckBox * > m_diagram_list_hash
Definition projectprintwindow.h:102
void on_m_fit_in_page_cb_clicked()
Definition projectprintwindow.cpp:685
void on_m_page_setup_triggered()
Definition projectprintwindow.cpp:748
void exportToPDF()
Definition projectprintwindow.cpp:670
QPrinter * m_printer
Definition projectprintwindow.h:99
QList< Diagram * > selectedDiagram() const
Definition projectprintwindow.cpp:657
void print()
Definition projectprintwindow.cpp:772
void on_m_display_two_page_action_triggered()
Definition projectprintwindow.cpp:740
void savePageSetupForCurrentPrinter()
Definition projectprintwindow.cpp:568
void requestPaint()
ProjectPrintWindow::requestPaint.
Definition projectprintwindow.cpp:191
void on_m_portrait_action_triggered()
Definition projectprintwindow.cpp:712
void on_m_date_cb_userDateChanged(const QDate &date)
Definition projectprintwindow.cpp:779
~ProjectPrintWindow()
ProjectPrintWindow::~ProjectPrintWindow.
Definition projectprintwindow.cpp:180
void on_m_next_page_action_triggered()
Definition projectprintwindow.cpp:726
void loadPageSetupForCurrentPrinter()
Definition projectprintwindow.cpp:457
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.
Definition projectprintwindow.cpp:48
void on_m_apply_date_pb_clicked()
Definition projectprintwindow.cpp:811
void on_m_check_all_pb_clicked()
Definition projectprintwindow.cpp:756
void on_m_zoom_in_action_triggered()
Definition projectprintwindow.cpp:696
QETProject * m_project
Definition projectprintwindow.h:98
Definition qetproject.h:62
Definition autonumberingdockwidget.h:26