diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-03-22 14:43:23 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-04-23 18:56:46 +0000 |
commit | 93818a359973003531e2a5ef2d55cf58b3d440d9 (patch) | |
tree | 6bb00a4e32a7da618aa178fd133792be02d8293d /src/quick/items/qquicktableview_p.h | |
parent | ebc45299ccf4750cfc0b93c39a60f94b7ec4ea7f (diff) |
QQuickTableView: add new 'syncView' property
This property can be set to point to another TableView.
If set, this TableView will be synchronized to the
other table with respect to flicking, column width, row
heights, spacing, etc. This logic is needed as a foundation
for the upcoming HeaderView.
Upcoming patches will implement this logic (together with
autotests) gradually.
Change-Id: Ic7dea8e1d1aa46bbb3ea6e795953a65c96c25cc6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview_p.h')
-rw-r--r-- | src/quick/items/qquicktableview_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquicktableview_p.h b/src/quick/items/qquicktableview_p.h index f32c71b983..3d46221574 100644 --- a/src/quick/items/qquicktableview_p.h +++ b/src/quick/items/qquicktableview_p.h @@ -79,6 +79,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTableView : public QQuickFlickable Q_PROPERTY(bool reuseItems READ reuseItems WRITE setReuseItems NOTIFY reuseItemsChanged) Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged) Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged) + Q_PROPERTY(QQuickTableView *syncView READ syncView WRITE setSyncView NOTIFY syncViewChanged REVISION 14) + Q_PROPERTY(Qt::Orientations syncDirection READ syncDirection WRITE setSyncDirection NOTIFY syncDirectionChanged REVISION 14) public: QQuickTableView(QQuickItem *parent = nullptr); @@ -110,6 +112,12 @@ public: void setContentWidth(qreal width); void setContentHeight(qreal height); + QQuickTableView *syncView() const; + void setSyncView(QQuickTableView *view); + + Qt::Orientations syncDirection() const; + void setSyncDirection(Qt::Orientations direction); + Q_INVOKABLE void forceLayout(); static QQuickTableViewAttached *qmlAttachedProperties(QObject *); @@ -124,6 +132,8 @@ Q_SIGNALS: void modelChanged(); void delegateChanged(); void reuseItemsChanged(); + Q_REVISION(14) void syncViewChanged(); + Q_REVISION(14) void syncDirectionChanged(); protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; |