24 #include <QPrintPreviewWidget> 25 #include <QPageSetupDialog> 40 setWindowTitle(
tr(
"QElectroTech : Aperçu avant impression"));
47 setWindowState(windowState() | Qt::WindowMaximized);
88 int preview_previous_page =
preview_ -> currentPage() - 1;
89 preview_ -> setCurrentPage(qMax(preview_previous_page, 0));
96 int preview_next_page =
preview_ -> currentPage() + 1;
97 preview_ -> setCurrentPage(qMin(preview_next_page,
preview_ -> pageCount()));
111 QPageSetupDialog page_setup_dialog(
printer_,
this);
112 if (page_setup_dialog.exec() == QDialog::Accepted) {
133 Q_UNUSED(fit_diagram);
208 if (!(
printer_ -> outputFileName().isEmpty())) {
210 page_setup_ -> setText(
tr(
"Mise en page (non disponible sous Windows pour l'impression PDF/PS)"));
242 "Si cette option est cochée, les marges de la feuille seront " 243 "ignorées et toute sa surface sera utilisée pour l'impression. " 244 "Cela peut ne pas être supporté par votre imprimante." 250 "Si cette option est cochée, le folio sera agrandi ou " 251 "rétréci de façon à remplir toute la surface imprimable " 252 "d'une et une seule page." 277 connect(
portrait_, SIGNAL(triggered()),
preview_, SLOT(setPortraitOrientation()));
295 connect(
buttons_, SIGNAL(accepted()),
this, SLOT(accept()));
296 connect(
buttons_, SIGNAL(rejected()),
this, SLOT(reject()));
349 int diagrams_count =
diagrams_list_ -> selectedDiagrams().count();
352 QList<QAbstractButton *> buttons =
buttons_ -> buttons();
353 if (buttons.count()) buttons[0] -> setEnabled(diagrams_count);
394 qreal current_zoom =
preview_ -> zoomFactor();
395 bool current_zoom_is_not_null = bool(
int(current_zoom * 100.0));
398 QList<qreal> zooms_real;
399 zooms_real << 0.25 << 0.5 << 0.75 << 1.0 << 1.5 << 2.0 << 4.0 << 8.0;
402 if (current_zoom_is_not_null && (!zooms_real.contains(current_zoom))) {
403 zooms_real << current_zoom;
404 std::sort(zooms_real.begin(), zooms_real.end());
408 int current_zoom_index = -1;
411 foreach (qreal z, zooms_real) {
412 zoom_box_ -> addItem(QString(
tr(
"%1 %")).arg(z * 100.0, 0,
'f', 2), z);
413 if (z == current_zoom) current_zoom_index =
zoom_box_ -> count() - 1;
415 zoom_box_ -> setCurrentIndex(current_zoom_index);
ExportProperties exportProperties() const
void setPrintOptionsVisible(bool)
QAction * all_pages_view_
QGroupBox * print_options_box_
DiagramsChooser * diagrams_list_
DiagramsChooser * diagramsChooser()
QPushButton * diagrams_select_all_
QETPrintPreviewDialog(QETProject *, QPrinter *, QWidget *=nullptr, Qt::WindowFlags=nullptr)
QLabel * use_full_page_label_
QAction * toggle_print_options_
ExportPropertiesWidget * render_properties_
QCheckBox * use_full_page_
QPrintPreviewWidget * preview_
~QETPrintPreviewDialog() override
QDialogButtonBox * buttons_
bool fitDiagramsToPages() const
static ExportProperties defaultPrintProperties()
ExportProperties::defaultPrintProperties.
QAction * toggle_diagrams_list_
void checkDiagramsCount()
void setDiagramsListVisible(bool)
QCheckBox * fit_diagram_to_page_
void paintRequested(const QList< Diagram *> &, bool, const ExportProperties, QPrinter *)
QLabel * fit_diagram_to_page_label_
QPushButton * diagrams_select_none_
void requestPaint(QPrinter *)
QAction * facing_pages_view_
QAction * single_page_view_
void fitDiagramToPage(bool)