| 1530 | } |
| 1531 | |
| 1532 | void MainWindow::print() |
| 1533 | { |
| 1534 | QPrintPreviewDialog printDialog(this, Qt::Window); |
| 1535 | EditorPrintPreviewRenderer renderer(currentEditor()); |
| 1536 | |
| 1537 | connect(&printDialog, &QPrintPreviewDialog::paintRequested, &renderer, &EditorPrintPreviewRenderer::render); |
| 1538 | |
| 1539 | // TODO: load/save the page layout that was used and reload it next time |
| 1540 | //preview.printer()->setPageLayout( /* todo */ ); |
| 1541 | |
| 1542 | printDialog.printer()->setPageMargins(QMarginsF(.5, .5, .5, .5), QPageLayout::Inch); |
| 1543 | |
| 1544 | connect(&printDialog, &QPrintPreviewDialog::accepted, this, [&]() { |
| 1545 | qInfo() << printDialog.printer()->pageLayout(); |
| 1546 | }); |
| 1547 | |
| 1548 | printDialog.exec(); |
| 1549 | } |
| 1550 | |
| 1551 | void MainWindow::convertEOLs(int eolMode) |
| 1552 | { |
nothing calls this directly
no outgoing calls
no test coverage detected