diff options
author | Yulong Bai <yulong.bai@qt.io> | 2019-10-23 16:26:08 +0200 |
---|---|---|
committer | Yulong Bai <yulong.bai@qt.io> | 2019-11-27 16:53:12 +0100 |
commit | 878814ebd4398727bfbcc5b94f0b78a3617a0c19 (patch) | |
tree | 82ac1a202f1545251666b3bc8f5c2229277bbbaa /src/quick/items/qquicktableview.cpp | |
parent | 3027d1369987cd03391cf645bd517ec5e33a18d8 (diff) |
TableView: add doc for syncView and syncDirection properties
Change-Id: I4a50087b07e6dfe37c9b48d1e3bb73ea50ea64a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 89839c8aab..b9649634c8 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -2714,6 +2714,23 @@ void QQuickTableView::setContentHeight(qreal height) QQuickFlickable::setContentHeight(height); } +/*! + \qmlproperty TableView QtQuick::TableView::syncView + + If this property of a TableView is set to another TableView, both the + tables will synchronize with regard to flicking, column widths/row heights, + and spacing according to \l syncDirection. + + If \l syncDirection contains \l Qt.Horizontal, current tableView's column + widths, column spacing, and horizontal flicking movement synchronizes with + syncView's. + + If \l syncDirection contains \l Qt.Vertical, current tableView's row + heights, row spacing, and vertical flicking movement synchronizes with + syncView's. + + \sa syncDirection +*/ QQuickTableView *QQuickTableView::syncView() const { return d_func()->assignedSyncView; @@ -2731,6 +2748,24 @@ void QQuickTableView::setSyncView(QQuickTableView *view) emit syncViewChanged(); } +/*! + \qmlproperty Qt::Orientations QtQuick::TableView::syncDirection + + If the \l syncView is set on a TableView, this property controls + synchronization of flicking direction(s) for both tables. The default is \c + {Qt.Horizontal | Qt.Vertical}, which means that if you flick either table + in either direction, the other table is flicked the same amount in the + same direction. + + This property and \l syncView can be used to make two tableViews + synchronize with each other smoothly in flicking regardless of the different + overshoot/undershoot, velocity, acceleration/deceleration or rebound + animation, and so on. + + A typical use case is to make several headers flick along with the table. + + \sa syncView, headerView +*/ Qt::Orientations QQuickTableView::syncDirection() const { return d_func()->assignedSyncDirection; |