widgets: flake8 and pylint fixes
[git-cola.git] / qtpy / QtPrintSupport.py
blob263747d2c8f1f5d8ed7d62c582cfdff56fb90856
1 # -----------------------------------------------------------------------------
2 # Copyright © 2009- The Spyder Development Team
4 # Licensed under the terms of the MIT License
5 # (see LICENSE.txt for details)
6 # -----------------------------------------------------------------------------
8 """Provides QtPrintSupport classes and functions."""
10 from . import PYQT5, PYQT6, PYSIDE6, PYSIDE2
12 if PYQT5:
13 from PyQt5.QtPrintSupport import *
14 elif PYQT6:
15 from PyQt6.QtPrintSupport import *
16 QPageSetupDialog.exec_ = lambda self, *args, **kwargs: self.exec(*args, **kwargs)
17 QPrintDialog.exec_ = lambda self, *args, **kwargs: self.exec(*args, **kwargs)
18 QPrintPreviewWidget.print_ = lambda self, *args, **kwargs: self.print(*args, **kwargs)
19 elif PYSIDE6:
20 from PySide6.QtPrintSupport import *
21 # Map DeprecationWarning methods
22 QPageSetupDialog.exec_ = lambda self, *args, **kwargs: self.exec(*args, **kwargs)
23 QPrintDialog.exec_ = lambda self, *args, **kwargs: self.exec(*args, **kwargs)
24 elif PYSIDE2:
25 from PySide2.QtPrintSupport import *