이 페이지에서

QTextTableCell Class

QTextTableCell 클래스는 QTextTable 내 셀의 속성을 나타냅니다. 더 보기...

헤더: #include <QTextTableCell>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

공개 함수

QTextTableCell()
QTextTableCell(const QTextTableCell &other)
~QTextTableCell()
QTextFrame::iterator begin() const
int column() const
int columnSpan() const
QTextFrame::iterator end() const
QTextCursor firstCursorPosition() const
QTextCharFormat format() const
bool isValid() const
QTextCursor lastCursorPosition() const
int row() const
int rowSpan() const
void setFormat(const QTextCharFormat &format)
int tableCellFormatIndex() const
bool operator!=(const QTextTableCell &other) const
QTextTableCell &operator=(const QTextTableCell &other)
bool operator==(const QTextTableCell &other) const

상세 설명

테이블 셀은 테이블에 속하는 문서 구조의 일부입니다. 테이블은 셀을 특정 행과 열로 정렬하며, 셀은 여러 열과 행에 걸쳐 있을 수도 있습니다.

셀은 일반적으로 QTextCursor::insertTable()을 사용하여 문서에 테이블을 삽입할 때 생성되지만, 테이블의 크기가 조정될 때도 생성 및 소멸됩니다.

셀에는 테이블 내 위치에 대한 정보가 포함되어 있습니다. 셀의 row() 및 column() 번호와 rowSpan() 및 columnSpan()을 얻을 수 있습니다.

셀의 format()는 해당 셀 내용의 기본 문자 서식을 나타냅니다. firstCursorPosition() 및 lastCursorPosition() 함수는 문서 내에서 셀이 차지하는 범위를 확인하는 데 사용됩니다.

QTextTable 및 QTextTableFormat도 참조하십시오 .

멤버 함수 설명서

QTextTableCell::QTextTableCell()

유효하지 않은 테이블 셀을 생성합니다.

isValid()도 참조하십시오 .

QTextTableCell::QTextTableCell(const QTextTableCell &other)

복사 생성자. ` other ` 셀을 기반으로 새로운 `QTextTableCell` 객체를 생성합니다.

[noexcept] QTextTableCell::~QTextTableCell()

테이블 셀을 삭제합니다.

QTextFrame::iterator QTextTableCell::begin() const

테이블 셀의 시작 부분을 가리키는 프레임 이터레이터를 반환합니다.

end()도 참조하십시오 .

int QTextTableCell::column() const

이 셀이 포함된 테이블의 열 번호를 반환합니다.

row()도 참조하십시오 .

int QTextTableCell::columnSpan() const

이 셀이 차지하는 열의 수를 반환합니다. 기본값은 1입니다.

rowSpan()도 참조하십시오 .

QTextFrame::iterator QTextTableCell::end() const

테이블 셀의 끝을 가리키는 프레임 이터레이터를 반환합니다.

begin()도 참조하십시오 .

QTextCursor QTextTableCell::firstCursorPosition() const

이 셀에서 유효한 첫 번째 커서 위치를 반환합니다.

lastCursorPosition()도 참조하십시오 .

QTextCharFormat QTextTableCell::format() const

셀의 문자 서식을 반환합니다.

setFormat()도 참조하십시오 .

bool QTextTableCell::isValid() const

이 값이 유효한 테이블 셀인 경우 ` true `을 반환하고, 그렇지 않은 경우 `false`를 반환합니다.

QTextCursor QTextTableCell::lastCursorPosition() const

이 셀에서 마지막으로 유효했던 커서 위치를 반환합니다.

firstCursorPosition()도 참조하십시오 .

int QTextTableCell::row() const

이 셀이 포함된 테이블의 행 번호를 반환합니다.

column()도 참조하십시오 .

int QTextTableCell::rowSpan() const

이 셀이 차지하는 행의 수를 반환합니다. 기본값은 1입니다.

columnSpan()도 참조하십시오 .

void QTextTableCell::setFormat(const QTextCharFormat &format)

셀의 문자 서식을 format 로 설정합니다. 예를 들어, 이 기능을 사용하여 전체 셀의 배경색을 변경할 수 있습니다:

QTextTableCell cell = table->cellAt(2, 3);
QTextCharFormat format = cell.format();
format.setBackground(Qt::blue);
cell.setFormat(format);

이 함수를 통해 셀의 행 또는 열 범위를 변경할 수는 없습니다. 대신 ` QTextTable::mergeCells ` 및 ` QTextTable::splitCell `을 사용해야 합니다.

format()도 참조하십시오 .

int QTextTableCell::tableCellFormatIndex() const

문서의 내부 서식 목록에서 tableCell의 서식이 차지하는 인덱스를 반환합니다.

QTextDocument::allFormats()도 참조하십시오 .

bool QTextTableCell::operator!=(const QTextTableCell &other) const

이 셀 객체와 other 셀 객체가 서로 다른 셀을 나타내는 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.

QTextTableCell &QTextTableCell::operator=(const QTextTableCell &other)

other 테이블 셀을 이 테이블 셀에 할당합니다.

bool QTextTableCell::operator==(const QTextTableCell &other) const

이 셀 객체와 other 셀 객체가 동일한 셀을 나타내는 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.

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