CopperSpice API
1.9.2
|
Generates a PDF which can be used as a paint device. More...
Public Methods | |
QPdfWriter (const QString &filename) | |
QPdfWriter (QIODevice *device) | |
~QPdfWriter () | |
QString | creator () const |
bool | newPage () override |
QPageLayout | pageLayout () const override |
int | resolution () const |
void | setCreator (const QString &creator) |
void | setMargins (const QMarginsF &margins) override |
bool | setPageLayout (const QPageLayout &newPageLayout) override |
bool | setPageMargins (const QMarginsF &margins) override |
bool | setPageMargins (const QMarginsF &margins, QPageLayout::Unit units) override |
bool | setPageOrientation (QPageLayout::Orientation orientation) override |
bool | setPageSize (const QPageSize &size) override |
void | setPageSize (QPageSize::PageSizeId sizeId) override |
void | setPageSizeMM (const QSizeF &size) override |
void | setResolution (int resolution) |
void | setTitle (const QString &title) |
QString | title () const |
Public Methods inherited from QObject | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Public Methods inherited from QPagedPaintDevice | |
QPagedPaintDevice () | |
~QPagedPaintDevice () | |
QMarginsF | margins () const |
QPageSize::PageSizeId | pageSize () const |
QSizeF | pageSizeMM () const |
Public Methods inherited from QPaintDevice | |
virtual | ~QPaintDevice () |
int | colorCount () const |
int | depth () const |
int | devicePixelRatio () const |
qreal | devicePixelRatioF () const |
int | height () const |
int | heightMM () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
bool | paintingActive () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
int | width () const |
int | widthMM () const |
Protected Methods | |
int | metric (PaintDeviceMetric id) const override |
QPaintEngine * | paintEngine () const override |
Protected Methods inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Methods inherited from QPaintDevice | |
QPaintDevice () | |
Additional Inherited Members | |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Public Signals inherited from QObject | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots inherited from QObject | |
void | deleteLater () |
Static Public Methods inherited from QObject | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Properties inherited from QObject | |
objectName | |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QPdfWriter class is used to generate PDFs that can be used as a paint device. QPdfWriter generates PDF out of a series of drawing commands using QPainter. The newPage() method can be used to create several pages.
|
explicit |
Constructs a PDF writer that will write the pdf to filename.
|
explicit |
Constructs a PDF writer that will write the pdf to device.
QPdfWriter::~QPdfWriter | ( | ) |
Destroys the pdf writer.
QString QPdfWriter::creator | ( | ) | const |
Returns the creator of the document.
|
overrideprotectedvirtual |
Returns the metric information for the given paint device metric.
Reimplemented from QPaintDevice::metric()
|
overridevirtual |
Implements QPagedPaintDevice::newPage()
|
overridevirtual |
Returns the current page layout.
Use this method to access the current QPageSize, QMarginsF, QPageLayout::Orientation, QPageLayout::fullRect(), and QPageLayout::paintRect().
Since the return value is a copy of the current page layout, modifying properties will not affect the paint device. To change the print settings use methods like QPdfWriter::setPageMargins() or QPdfWriter::setPageLayout().
Reimplemented from QPagedPaintDevice::pageLayout()
|
overrideprotectedvirtual |
Implements QPaintDevice::paintEngine()
int QPdfWriter::resolution | ( | ) | const |
Returns the resolution of the PDF in DPI.
void QPdfWriter::setCreator | ( | const QString & | creator | ) |
Sets the creator of the document to creator.
|
overridevirtual |
Sets the page margins using margins. Margins are specified in millimeters. The margins are a hint to drawing methods and do not affect the coordinate system or clipping.
Reimplemented from QPagedPaintDevice::setMargins()
|
overridevirtual |
Sets the PDF page layout to newPageLayout. Returns true if the page layout was successfully set to newPageLayout.
You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page layout to a new page. You should not call any painting methods between a call to setPageLayout() and newPage() as the wrong paint metrics may be used.
Reimplemented from QPagedPaintDevice::setPageLayout()
|
overridevirtual |
Sets the PDF page margins in the current page layout units. Returns true if the page margins was successfully set to margins.
You should call this before calling QPainter::begin() or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used.
To get the current page margins use QPageLayout::margins().
Reimplemented from QPagedPaintDevice::setPageMargins()
|
overridevirtual |
Sets the PDF page margins defined in the given units. Returns true if the page margins were successfully set to margins.
You should call this before calling QPainter::begin() or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used.
To get the current page margins use QPageLayout::margins().
Reimplemented from QPagedPaintDevice::setPageMargins()
|
overridevirtual |
Sets the page orientation. Returns true if the page orientation was successfully set to orientation.
The page orientation is used to define the orientation of the page size when obtaining the page rect.
You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new orientation to a new page. You should not call any painting methods between a call to setPageOrientation() and newPage() as the wrong paint metrics may be used.
To get the current QPageLayout::Orientation use QPageLayout::pageOrientation().
Reimplemented from QPagedPaintDevice::setPageOrientation()
|
overridevirtual |
Sets the PDF page size to size. Returns true if the page size was successfully set.
To get the current QPageSize use QPageLayout::pageSize(). You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page size to a new page. You should not call any painting methods between a call to setPageSize() and newPage() as the wrong paint metrics may be used.
Reimplemented from QPagedPaintDevice::setPageSize()
|
overridevirtual |
Sets the PDF page size using the enum value sizeId.
Reimplemented from QPagedPaintDevice::setPageSize()
|
overridevirtual |
Sets the page size to size. size is specified in millimeters. If the size matches a standard QPageSize::PageSizeId then the page size will be used, otherwise the enum value of QPageSize::Custom will be set.
Reimplemented from QPagedPaintDevice::setPageSizeMM()
void QPdfWriter::setResolution | ( | int | resolution | ) |
Sets the PDF resolution in DPI. This setting affects the coordinate system as returned by, for example QPainter::viewport().
void QPdfWriter::setTitle | ( | const QString & | title | ) |
Sets the title of the document being created to title.
QString QPdfWriter::title | ( | ) | const |
Returns the title of the document.