diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-09-10 14:22:46 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-09-11 12:37:36 +0000 |
commit | 8e5578d3fcb86efad6bcde31a194ebd5009b1d70 (patch) | |
tree | a149bc9049b9e6eb9a2efe4263e5bf7781a56de1 /src/quick/items/qquicktableview_p_p.h | |
parent | 47039ed7fb69b541afd4e81cffe89c8640c5f831 (diff) |
QQuickTableView: override fixup() to preserve contentX/Y at start-up
Flickable::fixup() will be called from Flickable::componentComplete().
fixup() is a virtual function that subclasses can override to e.g
ensure that cells snap to grid etc (which is not yet supported by
TableView). The default implementation will check if the assigned
contentX/Y is within the current content item size, and adjust it
back to 0,0 if not. The problem is that during componentComplete(), the
table has not yet been built. And we don't want Flickable to reset
any assignments to contentX/Y until that has happened. So override the
function and block it from doing any adjustments before the table has
been built.
Change-Id: Id6c5a3b5f053f71bf1854573cd5b9dc3ecc9f246
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview_p_p.h')
-rw-r--r-- | src/quick/items/qquicktableview_p_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h index 9d5b5783e5..9ff2b2e10b 100644 --- a/src/quick/items/qquicktableview_p_p.h +++ b/src/quick/items/qquicktableview_p_p.h @@ -193,6 +193,7 @@ public: static inline QQuickTableViewPrivate *get(QQuickTableView *q) { return q->d_func(); } void updatePolish() override; + void fixup(AxisData &data, qreal minExtent, qreal maxExtent) override; public: QHash<int, FxTableItem *> loadedItems; |