QPrintEngine Class
QPrintEngine クラスは、QPrinter が特定の印刷サブシステムとどのように連携するかを定義するインターフェースです。詳細...
| ヘッダー: | #include <QPrintEngine> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS PrintSupport) target_link_libraries(mytarget PRIVATE Qt6::PrintSupport) |
| qmake: | QT += printsupport |
- 継承されたメンバーを含む、すべてのメンバーの一覧
- QPrintEngine は、Printer および Printing API の一部です。
注:このクラスのすべての関数は再入可能である。
パブリック型
| enum | PrintEnginePropertyKey { PPK_CollateCopies, PPK_ColorMode, PPK_Creator, PPK_Duplex, PPK_DocumentName, …, PPK_CustomBase } |
パブリック関数
| virtual | ~QPrintEngine() |
| virtual bool | abort() = 0 |
| virtual int | metric(QPaintDevice::PaintDeviceMetric id) const = 0 |
| virtual bool | newPage() = 0 |
| virtual QPrinter::PrinterState | printerState() const = 0 |
| virtual QVariant | property(QPrintEngine::PrintEnginePropertyKey key) const = 0 |
| virtual void | setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value) = 0 |
詳細な説明
独自の印刷エンジンを作成する場合、一般的な方法は、QPaintEngine と QPrintEngine の両方を派生させることです。印刷エンジンのさまざまなプロパティは、property() で取得し、setProperty() で設定します。
QPaintEngineも参照してください 。
メンバ型のドキュメント
enum QPrintEngine::PrintEnginePropertyKey
この列挙型は、プリントエンジンとQPrinter の間でプロパティを通信するために使用されます。プロパティは、特定のプリントエンジンによってサポートされている場合とそうでない場合があります。
| 定数 | 値 | 説明 |
|---|---|---|
QPrintEngine::PPK_CollateCopies | 0 | 印刷物を仕分けするかどうかを示すブール値。 |
QPrintEngine::PPK_ColorMode | 1 | QPrinter::ColorMode を指し、カラーまたはモノクロのいずれかです。 |
QPrintEngine::PPK_Creator | 2 | 文書の作成者を記述する文字列。 |
QPrintEngine::PPK_Duplex | 20 | 印刷時に用紙の両面を使用するかどうかを示すブール値。 |
QPrintEngine::PPK_DocumentName | 3 | スプーラー内のドキュメント名を記述する文字列。 |
QPrintEngine::PPK_FontEmbedding | 19 | ドキュメントのフォントデータをプリンタに送信するデータに埋め込むかどうかを示すブール値。 |
QPrintEngine::PPK_FullPage | 4 | プリンタで全ページ印刷を行うかどうかを示すブール値。 |
QPrintEngine::PPK_NumberOfCopies | 5 | 廃止されました。部数を指定する整数。代わりに PPK_CopyCount を使用してください。 |
QPrintEngine::PPK_Orientation | 6 | QPageLayout::Orientation の値を指定します。 |
QPrintEngine::PPK_OutputFileName | 7 | 出力ファイル名を文字列で指定します。ファイル名が空の場合、プリンタはファイルへの印刷を行わないことを示します。 |
QPrintEngine::PPK_PageOrder | 8 | QPrinter::PageOrder の値を指定します。 |
QPrintEngine::PPK_PageRect | 9 | ページの矩形を指定するQRect 。 |
QPrintEngine::PPK_PageSize | 10 | 非推奨。代わりに PPK_PaperSize を使用してください。 |
QPrintEngine::PPK_PaperRect | 11 | 用紙の矩形を指定するQRect 。 |
QPrintEngine::PPK_PaperSource | 12 | QPrinter::PaperSource の値を指定します。 |
QPrintEngine::PPK_PaperSources | 21 | 複数のQPrinter::PaperSource 値を指定します。 |
QPrintEngine::PPK_PaperName | 26 | 用紙の名前を指定する文字列。 |
QPrintEngine::PPK_PaperSize | PPK_PageSize | QPrinter::PaperSize の値を指定します。 |
QPrintEngine::PPK_PrinterName | 13 | プリンタの名前を指定する文字列。 |
QPrintEngine::PPK_PrinterProgram | 14 | 印刷に使用するプリンタプログラムの名前を指定する文字列。 |
QPrintEngine::PPK_Resolution | 15 | このプリンタのドット/インチ(dpi)を表す整数。 |
QPrintEngine::PPK_SelectionOption | 16 | |
QPrintEngine::PPK_SupportedResolutions | 17 | プリンタがサポートする解像度のセットを表す整数の QVariant のリスト。 |
QPrintEngine::PPK_WindowsPageSize | 18 | Windows 上の DM_PAPER エントリを指定する整数。 |
QPrintEngine::PPK_CustomPaperSize | 22 | QPrinter::Point 単位でのカスタム用紙サイズを指定するQSizeF 。 |
QPrintEngine::PPK_PageMargins | 23 | QPrinter::Point 単位での左、上、右、下の余白の値を含むQList<QVariant>。 |
QPrintEngine::PPK_CopyCount | 24 | 印刷する部数を指定する整数。 |
QPrintEngine::PPK_SupportsMultipleCopies | 25 | プリンタが 1 つのジョブで複数のコピーを印刷できるかどうかを示すブール値。 |
QPrintEngine::PPK_QPageSize | 27 | QPageSize オブジェクトを使用してページサイズを設定します。 |
QPrintEngine::PPK_QPageMargins | 28 | QMarginsF とQPageLayout::Unit の std::pair を使用して、ページの余白を設定します。 |
QPrintEngine::PPK_QPageLayout | 29 | QPageLayout オブジェクトを使用して、ページレイアウトを設定します。 |
QPrintEngine::PPK_CustomBase | 0xff00 | 拡張の基礎。 |
メンバ関数のドキュメント
[virtual noexcept] QPrintEngine::~QPrintEngine()
プリントエンジンを破壊します。
[pure virtual] bool QPrintEngine::abort()
プリントエンジンに対し、印刷処理を中止するよう指示します。成功した場合はtrueを返し、そうでない場合はfalse を返します。
[pure virtual] int QPrintEngine::metric(QPaintDevice::PaintDeviceMetric id) const
指定されたid のメトリクスを返します。
[pure virtual] bool QPrintEngine::newPage()
プリントエンジンに新しいページを開始するよう指示します。プリンタが新しいページを作成できた場合は `true ` を返し、そうでない場合は `false` を返します。
[pure virtual] QPrinter::PrinterState QPrintEngine::printerState() const
プリントエンジンによって使用されているプリンタの現在の状態を取得します。
[pure virtual] QVariant QPrintEngine::property(QPrintEngine::PrintEnginePropertyKey key) const
key で指定されたプリントエンジンのプロパティを返します。
setProperty()も参照してください 。
[pure virtual] void QPrintEngine::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
key で指定されたプリントエンジンのプロパティを、指定されたvalue に設定します。
property()も参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.