diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-11-05 16:52:53 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-11-26 10:02:42 +0100 |
commit | 5d0d181953968b532a62ab23ac0979e6d287f1af (patch) | |
tree | 7fe00f1ddf6492f7ef9a795cdc5ca7fab0444def | |
parent | e1ba12d0f7076a4cf63d49ec0613cc7662327db5 (diff) |
Doc: Fix documentation warnings
Change-Id: Ic7a9e19c9cc6acc5d43965d51c2296bff6d7db3a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/doc/treeview.qdocconf | 2 | ||||
-rw-r--r-- | src/qquicktreeview.cpp | 145 |
2 files changed, 69 insertions, 78 deletions
diff --git a/src/doc/treeview.qdocconf b/src/doc/treeview.qdocconf index d358434..13ddd89 100644 --- a/src/doc/treeview.qdocconf +++ b/src/doc/treeview.qdocconf @@ -4,7 +4,7 @@ version = $QT_VERSION project = TreeView description = A TreeView for QtQuick and QtQuickControls2 -moduleheader = TreeView +moduleheader = outputdir = $$QT_INSTALL_DOCS/treeview headerdirs += .. sourcedirs += .. diff --git a/src/qquicktreeview.cpp b/src/qquicktreeview.cpp index cf0e678..1ce13f4 100644 --- a/src/qquicktreeview.cpp +++ b/src/qquicktreeview.cpp @@ -52,7 +52,7 @@ (or a cell) with the mouse, or assign \l currentIndex a value explicitly. \note \c currentIndex is an index into the the view model. In this model, all - tree nodes that are \i visible in the view are flattened into a list that can be + tree nodes that are visible in the view are flattened into a list that can be shown in a table column. This also means that currentIndex.row is the table row relative to root node. To get the current index in the model, where the row is relative to parent @@ -101,17 +101,17 @@ an item to be current is done by either using the arrow keys, clicking on a row (or a cell) with the mouse, or assign a value to \l currentIndex explicitly. - \note Using \l currentItem is \i almost the same as calling - \l itemAtModelIndex(currentModelIndex). The difference is that the latter + \note Using \l currentItem is \e almost the same as calling + \c {itemAtModelIndex(currentModelIndex)}. The difference is that the latter expression will only change when \l currentModelIndex changes. But \l currentItem can also change as a result of the view doing a relayout behind the scenes (which can force delegate items to be reloaded or recycled). Since the item can be recycled or destroyed at any point in time behind the applications back, you should never store this value. - if \l currentIndex.valid is \c false, this property will be \c null. + if \c currentIndex.valid is \c false, this property will be \c null. - \sa itemAtCell(), currentIndex, currentModelIndex() + \sa itemAtCell(), currentIndex, currentModelIndex, itemAtModelIndex() */ /*! @@ -120,17 +120,15 @@ This property holds how you would like the user to be able navigate the tree. It can have the following values: - \list - \li TreeView.List - the tree view acts like as a list view. This means that + \value TreeView.List The tree view acts like as a list view. This means that the user can only navigate up and down in the tree, but not sideways to the other columns. In this mode the left and right arrow keys will collapse and expand nodes in the tree (in addition to \c Qt.Key_Space). - \li TreeView.Table - the tree view acts like a table view. This means that + \value TreeView.Table The tree view acts like a table view. This means that the user can navigate up and down, but also left and right through all the columns in the tree. In this mode the left and right arrow keys will - move \currentIndex left and right, and only \c Qt.Key_Space will toggle + move currentIndex left and right, and only \c Qt.Key_Space will toggle nodes to be collapsed or expanded. - \endlist \note the selected mode can also affect how the tree is styled by the delegate. */ @@ -139,32 +137,29 @@ \qmlproperty int QtQuick::TreeView::styleHints This property holds a set of hints that can be used to tweak the - appearance of the \l delegate without the need to create a custom one. + appearance of the delegate without the need to create a custom one. The hints that can be set is the following: - \list - \li styleHints.indicator - the color of the collapsed/expanded icon - \li styleHints.indicatorCurrent - the color of the current rows collapsed/expanded icon - \li styleHints.indicatorHovered - the color of the collapsed/expanded icon when hovered - \li styleHints.overlay - the color of the overlay used for \l currentIndex - \li styleHints.overlayHovered - the color of the overlay used for \l currentIndex when hovered - \li styleHints.foregroundOdd - the foreground color of odd rows - \li styleHints.backgroundOdd - the background color of odd rows - \li styleHints.foregroundEven - the foreground color of even rows - \li styleHints.backgroundEven - the background color of even rows - \li styleHints.foregroundCurrent - the foreground color of the current item (or - \li the whole row, if \l selectionMode is \l TreeView.List) - \li styleHints.backgroundCurrent - the background color of the current item (or - \li the whole row, if \l selectionMode is \l TreeView.List) - \li styleHints.foregroundHovered - the foreground color of the current item (or - \li the whole row, if \l selectionMode is \l TreeView.List) - \li hen hovered - \li styleHints.backgroundHovered - the background color of the current item when hovered (or - \li the whole row, if \l selectionMode is \l TreeView.List) - \li styleHints.indent - the horizontal space between a parent and a child node - \li styleHints.columnPadding - the padding between a cell and its contents - \li styleHints.font - the font used by text items in the delegate - \endlist + \value styleHints.indicator The color of the collapsed/expanded icon + \value styleHints.indicatorCurrent The color of the current rows collapsed/expanded icon + \value styleHints.indicatorHovered The color of the collapsed/expanded icon when hovered + \value styleHints.overlay The color of the overlay used for \l currentIndex + \value styleHints.overlayHovered The color of the overlay used for \l currentIndex when hovered + \value styleHints.foregroundOdd The foreground color of odd rows + \value styleHints.backgroundOdd The background color of odd rows + \value styleHints.foregroundEven The foreground color of even rows + \value styleHints.backgroundEven The background color of even rows + \value styleHints.foregroundCurrent The foreground color of the current item (or + the whole row, if \l navigationMode is \c TreeView.List) + \value styleHints.backgroundCurrent The background color of the current item (or + the whole row, if \l navigationMode is \c TreeView.List) + \value styleHints.foregroundHovered The foreground color of the current item when hovered (or + the whole row, if \l navigationMode is \c TreeView.List) + \value styleHints.backgroundHovered The background color of the current item when hovered (or + the whole row, if \l navigationMode is \c TreeView.List) + \value styleHints.indent The horizontal space between a parent and a child node + \value styleHints.columnPadding The padding between a cell and its contents + \value styleHints.font The font used by text items in the delegate \note a delegate is free to ignore any hints specified by the application. */ @@ -172,10 +167,10 @@ /*! \qmlmethod bool QtQuick::TreeView::hasChildren(row) - Returns if the given \row in the view is shown as + Returns if the given \a row in the view is shown as expanded. - \note \l row should be the row in the view, not in the model. + \note \a row should be the row in the view, not in the model. \sa viewIndex */ @@ -183,10 +178,10 @@ /*! \qmlmethod bool QtQuick::TreeView::hasSiblings(row) - Returns if the given \row in the view has + Returns if the given \a row in the view has siblings. - \note \l row should be the row in the view, not in the model. + \note \a row should be the row in the view, not in the model. \sa viewIndex */ @@ -195,9 +190,9 @@ \qmlmethod int QtQuick::TreeView::depth(row) Returns the depth (the number of parents up to - the root) of the given \row. + the root) of the given \a row. - \note \l row should be the row in the view, not in the model. + \note \a row should be the row in the view, not in the model. \sa viewIndex */ @@ -205,10 +200,10 @@ /*! \qmlmethod bool QtQuick::TreeView::isExpanded(row) - Returns if the given \row in the view is shown as + Returns if the given \a row in the view is shown as expanded. - \note \l row should be the row in the view, not in the model. + \note \a row should be the row in the view, not in the model. \sa viewIndex */ @@ -217,30 +212,30 @@ \qmlmethod QtQuick::TreeView::expand(row) Expands the tree node at the - given \row in the view. + given \a row in the view. \note this function will not affect the model, only the visual representation in the view. - \sa viewIndex, collapse(), expandModelIndex(), collapseModelIndex(), isCollapsed() + \sa viewIndex, collapse(), expandModelIndex(), collapseModelIndex(), isExpanded() */ /*! \qmlmethod QtQuick::TreeView::collapse(row) Collapses the tree node at the - given \row in the view. + given \a row in the view. \note this function will not affect the model, only the visual representation in the view. - \sa viewIndex, expand(), expandModelIndex(), collapseModelIndex(), isCollapsed() + \sa viewIndex, expand(), expandModelIndex(), collapseModelIndex(), isExpanded() */ /*! \qmlmethod QtQuick::TreeView::toggleExpanded(row) - Toggles if the tree node at the given \l row + Toggles if the tree node at the given \a row should be expanded. This is a convenience for doing: \code @@ -254,7 +249,7 @@ /*! \qmlmethod bool QtQuick::TreeView::isModelIndexExpanded(modelIndex) - Returns if the given \modelIndex is shown as expanded + Returns \c true if the given \a modelIndex is shown as expanded in the view. This is a convenience for doing: \code @@ -268,32 +263,32 @@ \qmlmethod QtQuick::TreeView::collapseModelIndex(modelIndex) Collapses the tree node at the - given \modelIndex. This is a convenience for doing: + given \a modelIndex. This is a convenience for doing: \code collapse(mapFromModel(modelIndex).row) \endcode - \sa viewIndex, collapse(), expand(), expandModelIndex(), isCollapsed() + \sa viewIndex, collapse(), expand(), expandModelIndex(), isExpanded() */ /*! \qmlmethod QtQuick::TreeView::expandModelIndex(modelIndex) Expands the tree node at the - given \modelIndex. This is a convenience for doing: + given \a modelIndex. This is a convenience for doing: \code expand(mapFromModel(modelIndex).row) \endcode - \sa viewIndex, collapse(), expand(), collapseModelIndex(), isCollapsed() + \sa viewIndex, collapse(), expand(), collapseModelIndex(), isExpanded() */ /*! \qmlmethod QtQuick::TreeView::toggleModelIndexExpanded(modelIndex) - Toggles if the tree node at the given \l modelIndex + Toggles if the tree node at the given \a modelIndex should be expanded. This is a convenience for doing: \code @@ -307,34 +302,30 @@ /*! \qmlmethod int QtQuick::TreeView::columnAtX(x, includeSpacing) - Returns the column under \l y in view coordinates. + Returns the column under \a x in view coordinates. - If \l includeSpacing is set to \l false, and \a x is on top + If \a includeSpacing is set to \c false, and \a x is on top of the spacing between the columns, the return value will be -1. - Otherwise, if \a x is on top of the spacing and \l includeSpacing - is set to \c true, the column closest to the position will be returned. - - \sa columnSpacing + Otherwise, if \a x is on top of the spacing and \a includeSpacing + is set to \c true, returns the column closest to the position. */ /*! \qmlmethod int QtQuick::TreeView::rowAtY(y, includeSpacing) - Returns the row under \l y in view coordinates. - - If \l includeSpacing is set to \l false, and \a y is on top - of the spacing between the rows, the return value will be -1. - Otherwise, if \a y is on top of the spacing and \l includeSpacing - is set to \c true, the row closest to the position will be returned. + Returns the row under \a y in view coordinates. - \sa rowSpacing + If \a includeSpacing is set to \c false, and \a y is on top + of the spacing between the rows, returns -1. + Otherwise, if \a y is on top of the spacing and \a includeSpacing + is set to \c true, returns the row closest to the position. */ /*! \qmlmethod Item QtQuick::TreeView::itemAtCell(point cell) - Returns the item inside the given table cell. If the cell - is not visible in the view, \c null will be returned. + Returns the item inside the given table \a cell. If the cell + is not visible in the view, returns \c null. \sa currentItem, itemAtIndex() */ @@ -342,8 +333,8 @@ /*! \qmlmethod Item QtQuick::TreeView::itemAtIndex(viewIndex) - Returns the item at the given view index. If \c viewIndex.valid - is \false, \c null will be returned. + Returns the item at the given view index \a viewIndex. If + \c viewIndex.valid is \c false, returns \c null. \sa currentItem, itemAtCell(), viewIndex(), itemAtModelIndex() */ @@ -351,9 +342,9 @@ /*! \qmlmethod Item QtQuick::TreeView::itemAtModelIndex(modelIndex) - Returns the item at the given model index. If the item that - represents the model index is not visible in the view, \c null - will be returned. Convenience for doing: + Returns the item at the given model index \a modelIndex. If the + item that represents the model index is not visible in the view, + returns \c null. Convenience for doing: \code itemAtIndex(mapFromModel(modelIndex)) @@ -366,7 +357,7 @@ \qmlmethod QModelIndex QtQuick::TreeView::viewIndex(column, row) Creates a model index into the view model from the given - \l row and \l column. + \a row and \a column. \note this index is only valid for use with the view. To create a model index to use with the model, refer to the documentation for @@ -376,8 +367,8 @@ /*! \qmlmethod QModelIndex QtQuick::TreeView::mapToModel(viewIndex) - Maps an index pointing to an item in the view (the view model), to the - corresponding model index in the \l model. + Maps \a viewIndex, an index pointing to an item in the view (the + view model), to the corresponding model index in the model. TreeView uses a view model internally to convert a tree model into a model suited to be shown in a \l TableView. This view model will @@ -391,7 +382,7 @@ /*! \qmlmethod QModelIndex QtQuick::TreeView::mapFromModel(modelIndex) - Maps an index pointing to an item in the \l model to the + Maps an index, \a modelIndex, pointing to an item in the model to the corresponding model index in the view (the view model). TreeView uses a view model internally to convert a tree model into |