11 import pathlib |
11 import pathlib |
12 |
12 |
13 from PyQt6 import uic |
13 from PyQt6 import uic |
14 from PyQt6.QtCore import QDir, QEvent, QSize, Qt |
14 from PyQt6.QtCore import QDir, QEvent, QSize, Qt |
15 from PyQt6.QtGui import QAction, QImageWriter, QKeySequence, QPainter |
15 from PyQt6.QtGui import QAction, QImageWriter, QKeySequence, QPainter |
16 from PyQt6.QtPrintSupport import QPrintDialog, QPrinter |
16 from PyQt6.QtPrintSupport import QPrintDialog, QPrinter, QPrintPreviewDialog |
17 from PyQt6.QtWidgets import ( |
17 from PyQt6.QtWidgets import ( |
18 QApplication, |
18 QApplication, |
19 QComboBox, |
19 QComboBox, |
20 QDialog, |
20 QDialog, |
21 QFrame, |
21 QFrame, |
561 |
561 |
562 def __printPreviewImage(self): |
562 def __printPreviewImage(self): |
563 """ |
563 """ |
564 Private slot to handle the Print Preview menu action. |
564 Private slot to handle the Print Preview menu action. |
565 """ |
565 """ |
566 from PyQt6.QtPrintSupport import QPrintPreviewDialog |
|
567 |
|
568 if self.mainWidget is None: |
566 if self.mainWidget is None: |
569 EricMessageBox.critical( |
567 EricMessageBox.critical( |
570 self, |
568 self, |
571 self.tr("Print Preview"), |
569 self.tr("Print Preview"), |
572 self.tr("""There is no UI file loaded."""), |
570 self.tr("""There is no UI file loaded."""), |