QTextImageFormat Class
QTextImageFormat クラスは、QTextDocument 内の画像に関する書式設定情報を提供します。詳細...
| ヘッダー: | #include <QTextImageFormat> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 継承元: | QTextCharFormat |
- 継承されたメンバーを含む、すべてのメンバーの一覧
- QTextImageFormat は、リッチテキスト処理 APIおよび暗黙的に共有されるクラスの一部です。
注:このクラスのすべての関数は再入可能です。
パブリック関数
| QTextImageFormat() | |
| qreal | height() const |
| bool | isValid() const |
| QTextLength | maximumWidth() const |
| QString | name() const |
| int | quality() const |
| void | setHeight(qreal height) |
| void | setMaximumWidth(QTextLength maximumWidth) |
| void | setName(const QString &name) |
| void | setQuality(int quality = 100) |
| void | setWidth(qreal width) |
| qreal | width() const |
詳細な説明
インライン画像は、Unicode 値 U+FFFC (OBJECT REPLACEMENT CHARACTER) によって表され、これには QTextImageFormat が関連付けられています。画像フォーマットは、setName() を使用して画像の位置を特定するために使用される名前を指定します。 画像が占める矩形のサイズは、setWidth() およびsetHeight() を使用してピクセル単位で指定されます。希望する画質は、setQuality() で設定できます。
画像は、Qt に画像リーダーが用意されている任意の形式で指定できるため、PNG、TIFF、その他のビットマップ形式に加え、SVG 描画も組み込むことができます。
QImage およびQImageReaderも参照してください 。
メンバ関数のドキュメント
QTextImageFormat::QTextImageFormat()
新しい画像フォーマットオブジェクトを作成します。
qreal QTextImageFormat::height() const
画像が占める矩形の高さを返します。
width() およびsetHeight()も参照してください 。
bool QTextImageFormat::isValid() const
この画像形式が有効な場合は `true ` を返し、そうでない場合は `false` を返します。
QTextLength QTextImageFormat::maximumWidth() const
画像が占める矩形の最大幅を返します。
width() およびsetMaximumWidth()も参照してください 。
QString QTextImageFormat::name() const
画像の名前を返します。この名前は、アプリケーションのリソースファイル内のエントリを指します。
setName()も参照してください 。
int QTextImageFormat::quality() const
setQuality() で設定された値を返します。
setQuality()も参照してください 。
void QTextImageFormat::setHeight(qreal height)
画像が占める矩形のheight を設定します。
height() およびsetWidth()も参照してください 。
void QTextImageFormat::setMaximumWidth(QTextLength maximumWidth)
画像が占める矩形のmaximumWidth を設定します。これは絶対値、または利用可能な文書サイズのパーセンテージで指定できます。
maximumWidth()、width)、およびsetHeight()も参照してください 。
void QTextImageFormat::setName(const QString &name)
画像のname を設定します。name は、アプリケーションのリソース内での画像の場所を特定するために使用されます。
「name()」も参照してください 。
void QTextImageFormat::setQuality(int quality = 100)
画像をエクスポートする際に、エクスポート機能が使用する品質を設定します。`QTextDocumentWriter ` は、`quality ` が 0 から 100 の間の値に設定されている場合、ODF ファイルへのエクスポート時にここで設定された `quality ` を使用して JPG 画像をエクスポートします。また、`quality ` が 100(デフォルト)以上の場合、PNG 画像をエクスポートします。
quality()も参照してください 。
void QTextImageFormat::setWidth(qreal width)
画像が占める矩形のwidth を設定します。
width()、setHeight()、およびmaximumWidth()も参照してください 。
qreal QTextImageFormat::width() const
画像が占める矩形の幅を返します。
© 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.