summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-15 14:17:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-16 07:58:36 +0200
commite06cf6eacc1dd71ed5f3463d0ec5bbb9ff27dd5f (patch)
treee495942ff6051873e5e94fd54af26882dfa96b74 /src
parent68a778e19684bcdae1334ad080e1630064af4a29 (diff)
downloadqtquickcontrols-e06cf6eacc1dd71ed5f3463d0ec5bbb9ff27dd5f.tar.gz
Remove currentRowItem and rename positionViewAtIndex
Again trying to make the api a bit more consistent at using row vs. index. Change-Id: I769ca34c7bde628757a19fd47744b5cb1054a154 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/TableView.qml23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index cf805151..132351b5 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -202,10 +202,6 @@ ScrollView {
This is the content footer of the TableView */
property alias contentFooter: listView.footer
- /*! \qmlproperty Item TableView::currentRowItem
- This is the current item of the TableView */
- property alias currentRowItem: listView.currentItem
-
/*! \qmlproperty int TableView::rowCount
The current number of rows */
readonly property alias rowCount: listView.count
@@ -227,15 +223,18 @@ ScrollView {
*/
property alias currentRow: listView.currentIndex
+ /*! \internal */
+ property alias __currentRowItem: listView.currentItem
+
/*! \qmlsignal TableView::activated()
Emitted when the user activates an item by single or double-clicking (depending on the platform).
*/
signal activated
/*!
- \qmlmethod TableView::positionViewAtIndex
+ \qmlmethod TableView::positionViewAtRow( int row, PositionMode mode )
- Positions the view such that the \a index is at the position specified by \a mode:
+ Positions the view such that the specified \a row is at the position defined by \a mode:
\list
\li ListView.Beginning - position item at the top of the view.
\li ListView.Center - position item in the center of the view.
@@ -245,27 +244,25 @@ ScrollView {
at the top of the view.
\endlist
- If using the \a index to position the view creates an empty space at the beginning
+ If positioning the \a row creates an empty space at the beginning
or end of the view, then the view is positioned at the boundary.
- The correct way to bring an item into view is with positionViewAtIndex.
-
Note that this method should only be called after the Component has completed.
To position the view at startup, this method should be called by Component.onCompleted.
For example, to position the view at the end at startup:
\code
- Component.onCompleted: table.positionViewAtIndex(rowCount -1, ListView.Contain)
+ Component.onCompleted: table.positionViewAtRow(rowCount -1, ListView.Contain)
\endcode
Depending on how the model is populated, the model may not be ready when
TableView Component.onCompleted is called. In that case you may need to
- delay the call to positionViewAtIndex by using a \l {Timer}.
+ delay the call to positionViewAtRow by using a \l {Timer}.
*/
- function positionViewAtIndex(index, mode) {
- listView.positionViewAtIndex(index, mode)
+ function positionViewAtRow(row, mode) {
+ listView.positionViewAtRow(row, mode)
}
style: Qt.createComponent(Settings.theme() + "/TableViewStyle.qml", root)