2018年4月27日

ItemSelectionModel

モジュール

QtQml.Models 2.2

クラス継承

QItemSelectionModel → QObject

プロパティー

currentIndex: QModelIndex = QModelIndex() readonly
hasSelection: bool = false readonly
model: QAbstractItemModel* = null
selection: QmlSequence(QItemSelection) = [] readonly
selectedIndexes: QmlSequence(QModelIndexList) = [] readonly

シグナル

currentChanged(QModelIndex current, QModelIndex previous)
currentColumnChanged(QModelIndex current, QModelIndex previous)
currentRowChanged(QModelIndex current, QModelIndex previous)
modelChanged(QAbstractItemModel* model)
selectionChanged(QItemSelection selected, QItemSelection deselected)

メソッド

bool columnIntersectsSelection(int column, QModelIndex parent)
bool isSelected(QModelIndex index)
bool isRowSelected(int row, QModelIndex parent)
bool isColumnSelected(int column, QModelIndex parent)
bool rowIntersectsSelection(int row, QModelIndex parent)
QModelIndexList selectedRows(int column = 0)
QModelIndexList selectedColumns(int row = 0)

スロット

void clear()
void clearCurrentIndex()
void clearSelection()
void reset()
void setCurrentIndex(QModelIndex index, QItemSelectionModel::SelectionFlags command)
void select(QModelIndex index, QItemSelectionModel::SelectionFlags command)
void select(QItemSelection selection, QItemSelectionModel::SelectionFlags command)

列挙フラグ

SelectionFlags
    NoUpdate
    Clear
    Select
    Deselect
    Toggle
    Current
    Rows
    Columns
    SelectCurrent
    ToggleCurrent
    ClearAndSelect

説明


プロパティーの説明

currentIndex: QModelIndex

hasSelection: bool

model: QAbstractItemModel*

selection: QmlSequence(QItemSelection)

selectedIndexes: QmlSequence(QModelIndexList)

シグナルの説明

currentChanged(QModelIndex current, QModelIndex previous)

currentColumnChanged(QModelIndex current, QModelIndex previous)

currentRowChanged(QModelIndex current, QModelIndex previous)

メソッドの説明

bool columnIntersectsSelection(int column, QModelIndex parent)

bool isSelected(QModelIndex index)

bool isRowSelected(int row, QModelIndex parent)

bool isColumnSelected(int column, QModelIndex parent)

bool rowIntersectsSelection(int row, QModelIndex parent)

QModelIndexList selectedRows(int column)

QModelIndexList selectedColumns(int row)

スロットの説明

void clear()

void clearCurrentIndex()

void clearSelection()

void reset()

void setCurrentIndex(QModelIndex index, QItemSelectionModel::SelectionFlags command)

void select(QModelIndex index, QItemSelectionModel::SelectionFlags command)

void select(QItemSelection selection, QItemSelectionModel::SelectionFlags command)

列挙フラグの説明


SelectionFlags
列挙値 説明
NoUpdate 0x0000 セレクション操作なし
Clear 0x0001
Select 0x0002
Deselect 0x0004
Toggle 0x0008
Current 0x0010
Rows 0x0020
Columns 0x0040
SelectCurrent Select | Current
ToggleCurrent Toggle | Current
ClearAndSelect Clear | Select

参考情報