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::mergeCellsQTextTable::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 を返す。

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