QPrinterInfo Class
QPrinterInfoクラスは、既存のプリンタに関する情報へのアクセスを提供します。詳細...
ヘッダ | #include <QPrinterInfo> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS PrintSupport) target_link_libraries(mytarget PRIVATE Qt6::PrintSupport) |
qmake: | QT += printsupport |
- 継承メンバを含む全メンバのリスト
- QPrinterInfoは、PrinterおよびPrinting APIの一部です。
パブリック関数
QPrinterInfo() | |
QPrinterInfo(const QPrinter &printer) | |
QPrinterInfo(const QPrinterInfo &other) | |
~QPrinterInfo() | |
QPrinter::ColorMode | defaultColorMode() const |
QPrinter::DuplexMode | defaultDuplexMode() const |
QPageSize | defaultPageSize() const |
QString | description() const |
bool | isDefault() const |
bool | isNull() const |
bool | isRemote() const |
QString | location() const |
QString | makeAndModel() const |
QPageSize | maximumPhysicalPageSize() const |
QPageSize | minimumPhysicalPageSize() const |
QString | printerName() const |
QPrinter::PrinterState | state() const |
QList<QPrinter::ColorMode> | supportedColorModes() const |
QList<QPrinter::DuplexMode> | supportedDuplexModes() const |
QList<QPageSize> | supportedPageSizes() const |
QList<int> | supportedResolutions() const |
bool | supportsCustomPageSizes() const |
QPrinterInfo & | operator=(const QPrinterInfo &other) |
静的パブリックメンバ
QStringList | availablePrinterNames() |
QList<QPrinterInfo> | availablePrinters() |
QPrinterInfo | defaultPrinter() |
QString | defaultPrinterName() |
QPrinterInfo | printerInfo(const QString &printerName) |
詳細説明
静的関数を使用して、QPrinterInfo オブジェクトのリストを生成します。リスト内の各 QPrinterInfo オブジェクトは 1 つのプリンターを表し、名前、サポートされる用紙サイズ、デフォルト・プリンターかどうかを照会できます。
メンバ関数ドキュメント
QPrinterInfo::QPrinterInfo()
空の QPrinterInfo オブジェクトを構築します。
isNull()も参照してください 。
[explicit]
QPrinterInfo::QPrinterInfo(const QPrinter &printer)
printer から QPrinterInfo オブジェクトを構築します。
QPrinterInfo::QPrinterInfo(const QPrinterInfo &other)
other のコピーを作成する。
[noexcept]
QPrinterInfo::~QPrinterInfo()
QPrinterInfo オブジェクトを破棄する。オブジェクト内の値への参照は無効になります。
[static]
QStringList QPrinterInfo::availablePrinterNames()
このシステムで利用可能なすべてのプリンタ名のリストを返す。
ほとんどのシステムで高速に動作するため、availablePrinters() の代わりにこれを使用することを推奨する。
ローカル・システムまたはリモート・プリント・サーバで変更が行われた場合、 リストは古くなる可能性があることに注意。必要なときに必要なQPrinterInfo インスタンスだけをインスタンス化し、呼び出す前に常に有効性をチェックする。
[static]
QList<QPrinterInfo> QPrinterInfo::availablePrinters()
このシステムで利用可能なすべてのプリンタについて、QPrinterInfo オブジェクトのリストを返す。
各プリンタ・インスタンスの作成には時間がかかり、特にネットワーク接続されたリモート・プリンタがある場合、ローカル・システムやリモート・プリント・サーバで変更が行われると保持されているインスタンスが古くなる可能性があるため、これを使用することは推奨されません。代わりにavailablePrinterNames ()を使用し、必要なときだけプリンタ・インスタンスをインスタンス化してください。
QPrinter::ColorMode QPrinterInfo::defaultColorMode() const
このプリンタのデフォルトのカラーモードを返します。
QPrinter::DuplexMode QPrinterInfo::defaultDuplexMode() const
このプリンタのデフォルトの両面モードを返します。
QPageSize QPrinterInfo::defaultPageSize() const
このプリンタの現在のデフォルトのページサイズを返します。
[static]
QPrinterInfo QPrinterInfo::defaultPrinter()
システムのデフォルト・プリンタを返す。
デフォルト・プリンタがない場合に備えて、使用する前にisNull() を使用して返り値をチェックする必要がある。
システムによっては、使用可能なプリンタがあってもデフォルト・プリンタに設定されて いないことがある。
isNull()、isDefault()、availablePrinters()も参照の こと。
[static]
QString QPrinterInfo::defaultPrinterName()
現在のデフォルトのプリンタ名を返します。
QString QPrinterInfo::description() const
プリンタの説明を人間が読める形で返す。
QPrinterInfo::printerName()も参照 。
bool QPrinterInfo::isDefault() const
このプリンタが現在デフォルトプリンタであるかどうかを返します。
bool QPrinterInfo::isNull() const
このQPrinterInfo オブジェクトがプリンタ定義を保持しているかどうかを返す。
空のQPrinterInfo オブジェクトは、例えば、システム上にプリンタが存在しないときにdefaultPrinter() を呼び出した場合に発生する可能性がある。
bool QPrinterInfo::isRemote() const
このプリンタがリモートネットワークプリンタであるかどうかを返します。
QString QPrinterInfo::location() const
プリンターの位置を人間が読める形で返します。
QString QPrinterInfo::makeAndModel() const
プリンターの製造元と機種を、人間が読める形で返します。
QPageSize QPrinterInfo::maximumPhysicalPageSize() const
このプリンタがサポートする最大の物理ページサイズを返します。
minimumPhysicalPageSize()も参照 。
QPageSize QPrinterInfo::minimumPhysicalPageSize() const
このプリンタでサポートされる最小物理ページサイズを返します。
maximumPhysicalPageSize()も参照 。
[static]
QPrinterInfo QPrinterInfo::printerInfo(const QString &printerName)
プリンタprinterName を返す。
指定したプリンタが存在しない場合に備えて、使用する前にisNull() を使用して返り値をチェックする必要がある。
isNull()も参照 。
QString QPrinterInfo::printerName() const
プリンタの名前を返します。
これはプリンタを識別するための一意な ID であり、人間が読めるものではありません。
QPrinterInfo::description() およびQPrinter::setPrinterName()も参照の こと。
QPrinter::PrinterState QPrinterInfo::state() const
このプリンタの現在の状態を返します。
この状態は、プラットフォーム、プリンタドライバ、またはプリンタ自体によって、必ずしも正確であるとは限りません。
QList<QPrinter::ColorMode> QPrinterInfo::supportedColorModes() const
このプリンタでサポートされているカラーモードを返します。
QList<QPrinter::DuplexMode> QPrinterInfo::supportedDuplexModes() const
このプリンタでサポートされている両面モードのリストを返します。
QList<QPageSize> QPrinterInfo::supportedPageSizes() const
このプリンタがサポートしているページサイズのリストを返します。
QList<int> QPrinterInfo::supportedResolutions() const
このプリンターがサポートしている解像度のリストを返します。
bool QPrinterInfo::supportsCustomPageSizes() const
このプリンタがカスタムページサイズをサポートしているかどうかを返します。
QPrinterInfo &QPrinterInfo::operator=(const QPrinterInfo &other)
QPrinterInfo オブジェクトをother と等しくなるように設定する。
© 2025 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.