QPrintPreviewWidget Class ReferenceThe QPrintPreviewWidget class provides a widget for previewing page layouts for printer output. More... #include <QPrintPreviewWidget> Inherits QWidget. This class was introduced in Qt 4.4. Public Types
Public Functions
Reimplemented Public Functions
Public Slots
Signals
Additional Inherited Members
Detailed DescriptionThe QPrintPreviewWidget class provides a widget for previewing page layouts for printer output. QPrintPreviewDialog uses a QPrintPreviewWidget internally, and the purpose of 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 QPrintPreviewDialog. Using QPrintPreviewWidget is straightforward:
See also QPrinter, QPrintDialog, QPageSetupDialog, and QPrintPreviewDialog. Member Type Documentationenum QPrintPreviewWidget::ViewModeThis enum is used to describe the view mode of the preview widget.
enum QPrintPreviewWidget::ZoomModeThis enum is used to describe zoom mode of the preview widget.
Member Function DocumentationQPrintPreviewWidget::QPrintPreviewWidget ( QPrinter * printer, QWidget * parent = 0, Qt::WindowFlags flags = 0 )Constructs a QPrintPreviewWidget based on printer and with parent as the parent widget. The widget flags flags are passed on to the QWidget constructor. See also QWidget::setWindowFlags(). QPrintPreviewWidget::QPrintPreviewWidget ( QWidget * parent = 0, Qt::WindowFlags flags = 0 )This is an overloaded function. This will cause QPrintPreviewWidget to create an internal, default constructed QPrinter object, which will be used to generate the preview. QPrintPreviewWidget::~QPrintPreviewWidget ()Destroys the QPrintPreviewWidget. int QPrintPreviewWidget::currentPage () constReturns the currently viewed page in the preview. See also setCurrentPage(). void QPrintPreviewWidget::fitInView () [slot]This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget::FitInView). void QPrintPreviewWidget::fitToWidth () [slot]This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget::FitToWidth). QPrinter::Orientation QPrintPreviewWidget::orientation () constReturns the current orientation of the preview. This value is obtained from the QPrinter object associated with the preview. See also setOrientation(). int QPrintPreviewWidget::pageCount () constReturns the number of pages in the preview. This function was introduced in Qt 4.6. void QPrintPreviewWidget::paintRequested ( QPrinter * printer ) [signal]This signal is emitted when the preview widget needs to generate a set of preview pages. printer is the printer associated with this preview widget. void QPrintPreviewWidget::previewChanged () [signal]This signal is emitted whenever the preview widget has changed some internal state, such as the orientation. void QPrintPreviewWidget::print () [slot]Prints the preview to the printer associated with the preview. void QPrintPreviewWidget::setAllPagesViewMode () [slot]This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::AllPagesView). void QPrintPreviewWidget::setCurrentPage ( int page ) [slot]Sets the current page in the preview. This will cause the view to skip to the beginning of page. See also currentPage(). void QPrintPreviewWidget::setFacingPagesViewMode () [slot]This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::FacingPagesView). void QPrintPreviewWidget::setLandscapeOrientation () [slot]This is a convenience function and is the same as calling setOrientation(QPrinter::Landscape). void QPrintPreviewWidget::setOrientation ( QPrinter::Orientation orientation ) [slot]Sets the current orientation to orientation. This value will be set on the QPrinter object associated with the preview. See also orientation(). void QPrintPreviewWidget::setPortraitOrientation () [slot]This is a convenience function and is the same as calling setOrientation(QPrinter::Portrait). void QPrintPreviewWidget::setSinglePageViewMode () [slot]This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget::SinglePageView). void QPrintPreviewWidget::setViewMode ( ViewMode mode ) [slot]Sets the view mode to mode. The default view mode is SinglePageView. See also viewMode(). void QPrintPreviewWidget::setVisible ( bool visible ) [virtual]Reimplemented from QWidget::setVisible(). void QPrintPreviewWidget::setZoomFactor ( qreal factor ) [slot]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. See also zoomFactor(). void QPrintPreviewWidget::setZoomMode ( ZoomMode zoomMode ) [slot]Sets the zoom mode to zoomMode. The default zoom mode is FitInView. See also zoomMode(), viewMode(), and setViewMode(). void QPrintPreviewWidget::updatePreview () [slot]This function updates the preview, which causes the paintRequested() signal to be emitted. ViewMode QPrintPreviewWidget::viewMode () constReturns the current view mode. The default view mode is SinglePageView. See also setViewMode(). qreal QPrintPreviewWidget::zoomFactor () constReturns the zoom factor of the view. See also setZoomFactor(). void QPrintPreviewWidget::zoomIn ( qreal factor = 1.1 ) [slot]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%. ZoomMode QPrintPreviewWidget::zoomMode () constReturns the current zoom mode. See also setZoomMode(), viewMode(), and setViewMode(). void QPrintPreviewWidget::zoomOut ( qreal factor = 1.1 ) [slot]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%. X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |