이 페이지에서

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과 연관된 유니코드 값 U+FFFC(OBJECT REPLACEMENT CHARACTER)로 표현됩니다. 이미지 형식은 setName()을 사용하여 이미지를 찾는 데 사용되는 이름을 지정합니다. 이미지가 차지할 직사각형의 크기는 setWidth() 및 setHeight()을 사용하여 픽셀 단위로 지정됩니다. 원하는 이미지 품질은 setQuality()을 사용하여 설정할 수 있습니다.

Qt SVG 형식은 Qt Image Formats에 포함되지 않으므로, Qt Image Formats에 포함된 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

이미지가 차지하는 직사각형의 너비를 반환합니다.

height() 및 setWidth()도 참조하십시오 .

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