• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QColorDialog

    下一话题

    QPlainTextEdit

    QPrintPreviewWidget

    详细描述

    PySide.QtGui.QPrintPreviewWidget class provides a widget for previewing page layouts for printer output.

    PySide.QtGui.QPrintPreviewDialog uses a PySide.QtGui.QPrintPreviewWidget internally, and the purpose of PySide.QtGui.QPrintPreviewWidget is to make it possible to embed the preview into other widgets. It also makes it possible to build a different user interface around it than the default one provided with PySide.QtGui.QPrintPreviewDialog .

    使用 PySide.QtGui.QPrintPreviewWidget is straightforward:

    class PySide.QtGui. QPrintPreviewWidget ( printer [ , parent=None [ , flags=0 ] ] )
    class PySide.QtGui. QPrintPreviewWidget ( [ parent=None [ , flags=0 ] ] )
    参数:
    PySide.QtGui.QPrintPreviewWidget. ZoomMode

    This enum is used to describe zoom mode of the preview widget.

    常量 描述
    QPrintPreviewWidget.CustomZoom The zoom is set to a custom zoom value.
    QPrintPreviewWidget.FitToWidth This mode fits the current page to the width of the view.
    QPrintPreviewWidget.FitInView This mode fits the current page inside the view.
    PySide.QtGui.QPrintPreviewWidget. ViewMode

    This enum is used to describe the view mode of the preview widget.

    常量 描述
    QPrintPreviewWidget.SinglePageView A mode where single pages in the preview is viewed.
    QPrintPreviewWidget.FacingPagesView A mode where the facing pages in the preview is viewed.
    QPrintPreviewWidget.AllPagesView A view mode where all the pages in the preview is viewed.
    PySide.QtGui.QPrintPreviewWidget. currentPage ( )
    返回类型: PySide.QtCore.int

    Returns the currently viewed page in the preview.

    PySide.QtGui.QPrintPreviewWidget. fitInView ( )

    This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget::FitInView) .

    PySide.QtGui.QPrintPreviewWidget. fitToWidth ( )

    This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget::FitToWidth) .

    PySide.QtGui.QPrintPreviewWidget. numPages ( )
    返回类型: PySide.QtCore.int

    Returns the number of pages in the preview.

    PySide.QtGui.QPrintPreviewWidget. orientation ( )
    返回类型: PySide.QtGui.QPrinter.Orientation

    Returns the current orientation of the preview. This value is obtained from the PySide.QtGui.QPrinter object associated with the preview.

    PySide.QtGui.QPrintPreviewWidget. pageCount ( )
    返回类型: PySide.QtCore.int

    Returns the number of pages in the preview.

    PySide.QtGui.QPrintPreviewWidget. paintRequested ( printer )
    参数: printer PySide.QtGui.QPrinter
    PySide.QtGui.QPrintPreviewWidget. previewChanged ( )
    PySide.QtGui.QPrintPreviewWidget. print_ ( )

    Prints the preview to the printer associated with the preview.

    PySide.QtGui.QPrintPreviewWidget. setAllPagesViewMode ( )

    This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::AllPagesView) .

    PySide.QtGui.QPrintPreviewWidget. setCurrentPage ( pageNumber )
    参数: pageNumber PySide.QtCore.int

    Sets the current page in the preview. This will cause the view to skip to the beginning of page .

    PySide.QtGui.QPrintPreviewWidget. setFacingPagesViewMode ( )

    This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::FacingPagesView) .

    PySide.QtGui.QPrintPreviewWidget. setLandscapeOrientation ( )

    This is a convenience function and is the same as calling setOrientation(QPrinter::Landscape) .

    PySide.QtGui.QPrintPreviewWidget. setOrientation ( orientation )
    参数: orientation PySide.QtGui.QPrinter.Orientation
    PySide.QtGui.QPrintPreviewWidget. setPortraitOrientation ( )

    This is a convenience function and is the same as calling setOrientation(QPrinter::Portrait) .

    PySide.QtGui.QPrintPreviewWidget. setSinglePageViewMode ( )

    This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::SinglePageView) .

    PySide.QtGui.QPrintPreviewWidget. setViewMode ( viewMode )
    参数: viewMode PySide.QtGui.QPrintPreviewWidget.ViewMode

    Sets the view mode to mode . The default view mode is SinglePageView .

    PySide.QtGui.QPrintPreviewWidget. setZoomFactor ( zoomFactor )
    参数: zoomFactor PySide.QtCore.qreal

    Sets the zoom factor of the view to factor . For example, a value of 1.0 indicates an unscaled view, which is approximately the size the view will have on paper. A value of 0.5 will halve the size of the view, while a value of 2.0 will double the size of the view.

    PySide.QtGui.QPrintPreviewWidget. setZoomMode ( zoomMode )
    参数: zoomMode PySide.QtGui.QPrintPreviewWidget.ZoomMode

    Sets the zoom mode to zoomMode . The default zoom mode is FitInView .

    PySide.QtGui.QPrintPreviewWidget. updatePreview ( )

    This function updates the preview, which causes the PySide.QtGui.QPrintPreviewWidget.paintRequested() signal to be emitted.

    PySide.QtGui.QPrintPreviewWidget. viewMode ( )
    返回类型: PySide.QtGui.QPrintPreviewWidget.ViewMode

    Returns the current view mode. The default view mode is SinglePageView .

    PySide.QtGui.QPrintPreviewWidget. zoomFactor ( )
    返回类型: PySide.QtCore.qreal

    Returns the zoom factor of the view.

    PySide.QtGui.QPrintPreviewWidget. zoomIn ( [ zoom=1.1 ] )
    参数: zoom PySide.QtCore.qreal

    Zooms the current view in by factor . The default value for factor is 1.1, which means the view will be scaled up by 10%.

    PySide.QtGui.QPrintPreviewWidget. zoomMode ( )
    返回类型: PySide.QtGui.QPrintPreviewWidget.ZoomMode

    Returns the current zoom mode.

    PySide.QtGui.QPrintPreviewWidget. zoomOut ( [ zoom=1.1 ] )
    参数: zoom PySide.QtCore.qreal

    Zooms the current view out by factor . The default value for factor is 1.1, which means the view will be scaled down by 10%.