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()
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

詳細説明

インライン画像は、関連する QTextImageFormat を持つ Unicode 値 U+FFFC (OBJECT REPLACEMENT CHARACTER) で表されます。画像フォーマットは、画像を探すのに使われるsetName() を持つ名前を指定します。画像が占める矩形のサイズは、setWidth() とsetHeight() を使ってピクセル単位で指定します。希望の画質は、setQuality ()で設定できる。

画像は、Qt が画像リーダを持つ形式であれば、どのような形式でも提供できますので、PNG や TIFF などのビットマップ形式と一緒に SVG 図面を含めることができます。

QImageQImageReaderも参照して ください。

メンバ関数ドキュメント

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

画像が占める矩形の幅を返します。

height() およびsetWidth()も参照 ください。

© 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.