Skip to content

PrintPreviewWidget

Qt Base Class: QPrintPreviewWidget

Signature: QPrintPreviewWidget(self, parent: Optional[PySide6.QtWidgets.QWidget] = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) -> None QPrintPreviewWidget(self, printer: PySide6.QtPrintSupport.QPrinter, parent: Optional[PySide6.QtWidgets.QWidget] = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) -> None

Base classes

Name Children Inherits
WidgetMixin
prettyqt.widgets.widget
QPrintPreviewWidget
PySide6.QtPrintSupport
QPrintPreviewWidget(self, parent: Optional[PySide6.QtWidgets.QWidget] \= None, flags: PySide6.QtCore.Qt.WindowType \= Default(Qt.WindowFlags)) -> None

⋔ Inheritance diagram

graph TD
  1473572230080["printsupport.PrintPreviewWidget"]
  1473293688240["widgets.WidgetMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473245548480["gui.PaintDeviceMixin"]
  1473572070256["QtPrintSupport.QPrintPreviewWidget"]
  1473290849680["QtWidgets.QWidget"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473300082368["QtGui.QPaintDevice"]
  1473293688240 --> 1473572230080
  1473299815024 --> 1473293688240
  140713234304496 --> 1473299815024
  1473245548480 --> 1473293688240
  140713234304496 --> 1473245548480
  1473572070256 --> 1473572230080
  1473290849680 --> 1473572070256
  1473288842240 --> 1473290849680
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473300082368 --> 1473290849680
  1473291690208 --> 1473300082368

🛈 DocStrings

Bases: WidgetMixin, QPrintPreviewWidget

Widget for previewing page layouts for printer output.

Source code in prettyqt\printsupport\printpreviewwidget.py
class PrintPreviewWidget(widgets.WidgetMixin, QtPrintSupport.QPrintPreviewWidget):
    """Widget for previewing page layouts for printer output."""

    def get_view_mode(self) -> ViewModeStr:
        return VIEW_MODE.inverse[self.viewMode()]

    def set_view_mode(
        self, mode: ViewModeStr | QtPrintSupport.QPrintPreviewWidget.ViewMode
    ):
        """Set view mode.

        Args:
            mode: view mode
        """
        self.setViewMode(VIEW_MODE.get_enum_value(mode))

    def get_zoom_mode(self) -> ZoomModeStr:
        return ZOOM_MODE.inverse[self.zoomMode()]

    def set_zoom_mode(
        self, mode: ZoomModeStr | QtPrintSupport.QPrintPreviewWidget.ZoomMode
    ):
        """Set zoom mode.

        Args:
            mode: zoom mode
        """
        self.setZoomMode(ZOOM_MODE.get_enum_value(mode))

set_view_mode(mode: ViewModeStr | QtPrintSupport.QPrintPreviewWidget.ViewMode)

Set view mode.

Parameters:

Name Type Description Default
mode ViewModeStr | ViewMode

view mode

required
Source code in prettyqt\printsupport\printpreviewwidget.py
def set_view_mode(
    self, mode: ViewModeStr | QtPrintSupport.QPrintPreviewWidget.ViewMode
):
    """Set view mode.

    Args:
        mode: view mode
    """
    self.setViewMode(VIEW_MODE.get_enum_value(mode))

set_zoom_mode(mode: ZoomModeStr | QtPrintSupport.QPrintPreviewWidget.ZoomMode)

Set zoom mode.

Parameters:

Name Type Description Default
mode ZoomModeStr | ZoomMode

zoom mode

required
Source code in prettyqt\printsupport\printpreviewwidget.py
def set_zoom_mode(
    self, mode: ZoomModeStr | QtPrintSupport.QPrintPreviewWidget.ZoomMode
):
    """Set zoom mode.

    Args:
        mode: zoom mode
    """
    self.setZoomMode(ZOOM_MODE.get_enum_value(mode))

⌗ Property table

Qt Property Type Doc
objectName QString
modal bool
windowModality Qt::WindowModality
enabled bool
geometry QRect
frameGeometry QRect
normalGeometry QRect
x int
y int
pos QPoint
frameSize QSize
size QSize
width int
height int
rect QRect
childrenRect QRect
childrenRegion QRegion
sizePolicy QSizePolicy
minimumSize QSize
maximumSize QSize
minimumWidth int
minimumHeight int
maximumWidth int
maximumHeight int
sizeIncrement QSize
baseSize QSize
palette QPalette
font QFont
cursor QCursor
mouseTracking bool
tabletTracking bool
isActiveWindow bool
focusPolicy Qt::FocusPolicy
focus bool
contextMenuPolicy Qt::ContextMenuPolicy
updatesEnabled bool
visible bool
minimized bool
maximized bool
fullScreen bool
sizeHint QSize
minimumSizeHint QSize
acceptDrops bool
windowTitle QString
windowIcon QIcon
windowIconText QString
windowOpacity double
windowModified bool
toolTip QString
toolTipDuration int
statusTip QString
whatsThis QString
accessibleName QString
accessibleDescription QString
layoutDirection Qt::LayoutDirection
autoFillBackground bool
styleSheet QString
locale QLocale
windowFilePath QString
inputMethodHints QFlags