|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QPrintPreviewWidget
public class QPrintPreviewWidget
The 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:
Construct the QPrintPreviewWidget either by passing in an exisiting QPrinter
object, or have QPrintPreviewWidget create a default constructed QPrinter
object for you.
paintRequested()
signal to a slot. When the widget needs to generate a set of preview pages, a paintRequested()
signal will be emitted from the widget. Connect a slot to this signal, and draw onto the QPrinter
passed in as a signal parameter. Call QPrinter::newPage()
, to start a new page in the preview.
QPrinter
, QPrintDialog
, QPageSetupDialog
, and QPrintPreviewDialog
.
Nested Class Summary | |
---|---|
static class |
QPrintPreviewWidget.ViewMode
This enum is used to describe the view mode of the preview widget. |
static class |
QPrintPreviewWidget.ZoomMode
This enum is used to describe zoom mode of the preview widget. |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
paintRequested
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal0 |
previewChanged
This signal is emitted whenever the preview widget has changed some internal state, such as the orientation. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QPrintPreviewWidget()
This is an overloaded member function, provided for convenience. |
|
QPrintPreviewWidget(QPrinter printer)
Constructs a QPrintPreviewWidget based on printer and with parent as the parent widget. |
|
QPrintPreviewWidget(QPrinter printer,
QWidget parent)
Constructs a QPrintPreviewWidget based on printer and with parent as the parent widget. |
|
QPrintPreviewWidget(QPrinter printer,
QWidget parent,
Qt.WindowFlags flags)
Constructs a QPrintPreviewWidget based on printer and with parent as the parent widget. |
|
QPrintPreviewWidget(QPrinter printer,
QWidget parent,
Qt.WindowType[] flags)
This is an overloaded method provided for convenience. |
|
QPrintPreviewWidget(QWidget parent)
This is an overloaded member function, provided for convenience. |
|
QPrintPreviewWidget(QWidget parent,
Qt.WindowFlags flags)
This is an overloaded member function, provided for convenience. |
|
QPrintPreviewWidget(QWidget parent,
Qt.WindowType[] flags)
This is an overloaded method provided for convenience. |
Method Summary | |
---|---|
int |
currentPage()
Returns the currently viewed page in the preview. |
void |
fitInView()
This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget.:FitInView). |
void |
fitToWidth()
This is a convenience function and is the same as calling setZoomMode(QPrintPreviewWidget.:FitToWidth). |
int |
numPages()
Returns the number of pages in the preview. |
QPrinter.Orientation |
orientation()
Returns the current orientation of the preview. |
void |
print()
Prints the preview to the printer associated with the preview. |
void |
setAllPagesViewMode()
This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget.:AllPagesView). |
void |
setCurrentPage(int pageNumber)
Sets the current page in the preview. |
void |
setFacingPagesViewMode()
This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget.:FacingPagesView). |
void |
setLandscapeOrientation()
This is a convenience function and is the same as calling setOrientation(QPrinter.:Landscape). |
void |
setOrientation(QPrinter.Orientation orientation)
Sets the current orientation to orientation. |
void |
setPortraitOrientation()
This is a convenience function and is the same as calling setOrientation(QPrinter.:Landscape). |
void |
setSinglePageViewMode()
This is a convenience function and is the same as calling setViewMode(QPrintPreviewWidget.:SinglePageView). |
void |
setViewMode(QPrintPreviewWidget.ViewMode viewMode)
Sets the view mode to mode. |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor of the view to factor. |
void |
setZoomMode(QPrintPreviewWidget.ZoomMode zoomMode)
Sets the zoom mode to zoomMode. |
void |
updatePreview()
This function updates the preview, which causes the paintRequested() signal to be emitted. |
QPrintPreviewWidget.ViewMode |
viewMode()
Returns the current view mode. |
double |
zoomFactor()
Returns the zoom factor of the view. |
void |
zoomIn()
Zooms the current view in by factor. |
void |
zoomIn(double zoom)
Zooms the current view in by factor. |
QPrintPreviewWidget.ZoomMode |
zoomMode()
Returns the current zoom mode. |
void |
zoomOut()
Zooms the current view out by factor. |
void |
zoomOut(double zoom)
Zooms the current view out by factor. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 paintRequested
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QPrinter(named: printer)>:
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.
public final QSignalEmitter.Signal0 previewChanged
Constructor Detail |
---|
public QPrintPreviewWidget(QPrinter printer, QWidget parent, Qt.WindowType[] flags)
public QPrintPreviewWidget(QPrinter printer, QWidget parent)
QWidget
constructor. QWidget::setWindowFlags()
.
public QPrintPreviewWidget(QPrinter printer)
QWidget
constructor. QWidget::setWindowFlags()
.
public QPrintPreviewWidget(QPrinter printer, QWidget parent, Qt.WindowFlags flags)
QWidget
constructor. QWidget::setWindowFlags()
.
public QPrintPreviewWidget(QWidget parent, Qt.WindowType[] flags)
public QPrintPreviewWidget(QWidget parent)
This will cause QPrintPreviewWidget to create an internal, default constructed QPrinter
object, which will be used to generate the preview.
public QPrintPreviewWidget()
This will cause QPrintPreviewWidget to create an internal, default constructed QPrinter
object, which will be used to generate the preview.
public QPrintPreviewWidget(QWidget parent, Qt.WindowFlags flags)
This will cause QPrintPreviewWidget to create an internal, default constructed QPrinter
object, which will be used to generate the preview.
Method Detail |
---|
public final int currentPage()
setCurrentPage()
.
public final void fitInView()
public final void fitToWidth()
public final int numPages()
public final QPrinter.Orientation orientation()
QPrinter
object associated with the preview. setOrientation()
.
public final void print()
public final void setAllPagesViewMode()
public final void setCurrentPage(int pageNumber)
currentPage()
.
public final void setFacingPagesViewMode()
public final void setLandscapeOrientation()
public final void setOrientation(QPrinter.Orientation orientation)
QPrinter
object associated with the preview. orientation()
.
public final void setPortraitOrientation()
public final void setSinglePageViewMode()
public final void setViewMode(QPrintPreviewWidget.ViewMode viewMode)
SinglePageView
. viewMode()
.
public final void setZoomFactor(double zoomFactor)
zoomFactor()
.
public final void setZoomMode(QPrintPreviewWidget.ZoomMode zoomMode)
FitInView
. zoomMode()
, viewMode()
, and setViewMode()
.
public final void updatePreview()
paintRequested()
signal to be emitted.
public final QPrintPreviewWidget.ViewMode viewMode()
SinglePageView
. setViewMode()
.
public final double zoomFactor()
setZoomFactor()
.
public final void zoomIn()
public final void zoomIn(double zoom)
public final QPrintPreviewWidget.ZoomMode zoomMode()
setZoomMode()
, viewMode()
, and setViewMode()
.
public final void zoomOut()
public final void zoomOut(double zoom)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |