aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2018-07-16 15:35:47 +0200
committerPaul Wicking <paul.wicking@qt.io>2018-07-31 09:39:24 +0000
commit5f364acefa3ce8bc770dd4ddb6d962d9f2ecf292 (patch)
tree46e3f463bfd934c9358f41acf482cbe017556aa2
parent3b3e0c4d80090120fb94fcd42221ddd79a8d0933 (diff)
Doc: Extend ItemSelectionModel QML documentation
This change provides a bare minimum documentation for the ItemSelectionModel QML type. Task-number: QTBUG-58090 Change-Id: I0e232f8e05e7629d6f573f8dce21154d0ec307e5 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> (cherry picked from commit 9ee7b52f3234d12c7617ddf716f54e1923d3cded)
-rw-r--r--src/qml/types/qqmlitemselectionmodel.qdoc63
1 files changed, 59 insertions, 4 deletions
diff --git a/src/qml/types/qqmlitemselectionmodel.qdoc b/src/qml/types/qqmlitemselectionmodel.qdoc
index 29ac1aa17a..1dc959a9cd 100644
--- a/src/qml/types/qqmlitemselectionmodel.qdoc
+++ b/src/qml/types/qqmlitemselectionmodel.qdoc
@@ -35,9 +35,6 @@
\brief Instantiates a QItemSelectionModel to be used in conjunction
with a QAbstractItemModel and any view supporting it.
- This page only enumerates the properties, methods, and signals available in QML.
- See \l QItemSelectionModel for the actual documentation of this class.
-
\sa QItemSelectionModel, {Models and Views in Qt Quick}
*/
@@ -76,34 +73,67 @@
/*!
\qmlmethod bool ItemSelectionModel::isSelected(QModelIndex index)
+
+ Returns \c true if the given model item \a index is selected.
*/
/*!
\qmlmethod bool ItemSelectionModel::isRowSelected(int row, QModelIndex parent)
+
+ Returns \c true if all items are selected in the \a row with the given
+ \a parent.
+
+ Note that this function is usually faster than calling isSelected()
+ on all items in the same row, and that unselectable items are ignored.
*/
/*!
\qmlmethod bool ItemSelectionModel::isColumnSelected(int column, QModelIndex parent)
+
+ Returns \c true if all items are selected in the \a column with the given
+ \a parent.
+
+ Note that this function is usually faster than calling isSelected()
+ on all items in the same column, and that unselectable items are ignored.
*/
/*!
\qmlmethod bool ItemSelectionModel::rowIntersectsSelection(int row, QModelIndex parent)
+
+ Returns \c true if there are any items selected in the \a row with the
+ given \a parent.
*/
/*!
\qmlmethod bool ItemSelectionModel::columnIntersectsSelection(int column, QModelIndex parent)
+
+ Returns \c true if there are any items selected in the \a column with the
+ given \a parent.
*/
/*!
\qmlmethod QModelIndexList ItemSelectionModel::selectedRows(int column)
+
+ Returns the indexes in the given \a column for the rows where all columns
+ are selected.
+
+ \sa selectedColumns()
*/
/*!
\qmlmethod QModelIndexList ItemSelectionModel::selectedColumns(int row)
+
+ Returns the indexes in the given \a row for columns where all rows are
+ selected.
+
+ \sa selectedRows()
*/
/*!
- \qmlmethod QItemSelection ItemSelectionModel::selection()
+ \qmlproperty object ItemSelectionModel::selection
+ \readonly
+
+ Holds the selection ranges stored in the selection model.
*/
/*!
@@ -120,24 +150,49 @@
/*!
\qmlmethod void ItemSelectionModel::clear()
+
+ Clears the selection model. Emits selectionChanged() and currentChanged().
*/
/*!
\qmlmethod void ItemSelectionModel::reset()
+
+ Clears the selection model. Does not emit any signals.
*/
/*!
\qmlmethod void ItemSelectionModel::clearSelection()
+
+ Clears the selection in the selection model. Emits selectionChanged().
*/
/*!
\qmlmethod void ItemSelectionModel::clearCurrentIndex()
+
+ Clears the current index. Emits currentChanged().
*/
/*!
\qmlsignal ItemSelectionModel::selectionChanged(QItemSelection selected, QItemSelection deselected)
+
+ This signal is emitted whenever the selection changes. The change in the
+ selection is represented as an item selection of \a deselected items and
+ an item selection of \a selected items.
+
+ Note the that the current index changes independently from the selection.
+ Also note that this signal will not be emitted when the item model is reset.
+
+ \sa select(), currentChanged()
*/
/*!
\qmlsignal ItemSelectionModel::currentChanged(QModelIndex current, QModelIndex previous)
+
+ This signal is emitted whenever the current item changes. The \a previous
+ model item index is replaced by the \a current index as the selection's
+ current item.
+
+ Note that this signal will not be emitted when the item model is reset.
+
+ \sa currentIndex(), setCurrentIndex(), selectionChanged()
*/