aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview_p_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-08-09 09:15:08 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-08-09 16:20:56 +0000
commit1d6dcee6cc75b65092715acc59d4481a2dfeb5ec (patch)
tree85702162a38b943ef390555a73e63d4e5ebf7e0c /src/quick/items/qquicktableview_p_p.h
parent82da798499aa8b656e771191332864a703069739 (diff)
QQuickTableView: override contentWidth/Height properties
TableView uses contentWidth/height to report the size of the table (this will e.g make scrollbars written for Flickable work out of the box). This value is continuously calculated, and will change/improve as more columns are loaded into view. At the same time, we want to open up for the possibility that the application can set the content width explicitly, in case it knows what the exact width should be from the start. We therefore override the contentWidth/height properties from QQuickFlickable, to be able to implement this combined behavior. This also lets us lazy build the table if the application needs to know the content size early on. The latter will also fix problems related to querying the content size from Component.onCompleted. Change-Id: Ife7ef551dc46cf15d6940e3c6dff78545a3e4330 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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h
index e6e40e1bae..26b391818c 100644
--- a/src/quick/items/qquicktableview_p_p.h
+++ b/src/quick/items/qquicktableview_p_p.h
@@ -219,6 +219,18 @@ public:
QJSValue rowHeightProvider;
QJSValue columnWidthProvider;
+ // TableView uses contentWidth/height to report the size of the table (this
+ // will e.g make scrollbars written for Flickable work out of the box). This
+ // value is continuously calculated, and will change/improve as more columns
+ // are loaded into view. At the same time, we want to open up for the
+ // possibility that the application can set the content width explicitly, in
+ // case it knows what the exact width should be from the start. We therefore
+ // override the contentWidth/height properties from QQuickFlickable, to be able
+ // to implement this combined behavior. This also lets us lazy build the table
+ // if the application needs to know the content size early on.
+ QQmlNullableValue<qreal> explicitContentWidth;
+ QQmlNullableValue<qreal> explicitContentHeight;
+
const static QPoint kLeft;
const static QPoint kRight;
const static QPoint kUp;
@@ -311,6 +323,8 @@ public:
void columnsRemovedCallback(const QModelIndex &parent, int begin, int end);
void modelResetCallback();
+ bool updatePolishIfPossible() const;
+
inline QString tableLayoutToString() const;
void dumpTable() const;
};