diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-13 13:30:07 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-18 22:12:18 +0000 |
commit | 379ba8640a9cf7e43e848eb07c11989f0f4f3ddd (patch) | |
tree | 5131b7c128d36549677f239ea954edd8a1665365 /src/quick/items | |
parent | aec42f9953954d48a11465f56b5e5ee4987f3b44 (diff) |
QQuickTableView: remove TableView.cellWidth/Height
The attached properties TableView.cellWidth/Height were added
for corner cases where you couldn't set/override implicit size
for a delegate item. But now that we have added rowHeightProvider
and columnWidthProvider (and we know that we're going to offer a
broader API to set row/column size from a HeaderView), you have
a way out for those cases as well. So lets remove the attached
properties until we know for sure if they will be needed.
Change-Id: I7d20fb02c36aebd3f24964630ccb68d4c813e93e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 12 | ||||
-rw-r--r-- | src/quick/items/qquicktableview_p.h | 22 |
2 files changed, 0 insertions, 34 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index b5668ccf53..db1d262df7 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -490,29 +490,17 @@ Qt::Edge QQuickTableViewPrivate::nextEdgeToUnload(const QRectF rect) qreal QQuickTableViewPrivate::cellWidth(const QPoint& cell) { - // If a delegate item has TableView.cellWidth set, then - // we prefer that. Otherwise we fall back to use implicitWidth. // Using an items width directly is not an option, since we change // it during layout (which would also cause problems when recycling items). auto const cellItem = loadedTableItem(cell)->item; - if (auto const attached = getAttachedObject(cellItem)) { - if (!attached->m_cellWidth.isNull) - return attached->m_cellWidth; - } return cellItem->implicitWidth(); } qreal QQuickTableViewPrivate::cellHeight(const QPoint& cell) { - // If a delegate item has TableView.cellHeight set, then - // we prefer that. Otherwise we fall back to use implicitHeight. // Using an items height directly is not an option, since we change // it during layout (which would also cause problems when recycling items). auto const cellItem = loadedTableItem(cell)->item; - if (auto const attached = getAttachedObject(cellItem)) { - if (!attached->m_cellHeight.isNull) - return attached->m_cellHeight; - } return cellItem->implicitHeight(); } diff --git a/src/quick/items/qquicktableview_p.h b/src/quick/items/qquicktableview_p.h index c0dbaf4d48..fe18de5cc4 100644 --- a/src/quick/items/qquicktableview_p.h +++ b/src/quick/items/qquicktableview_p.h @@ -150,8 +150,6 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTableViewAttached : public QObject Q_OBJECT Q_PROPERTY(QQuickTableView *tableView READ tableView NOTIFY tableViewChanged) - Q_PROPERTY(qreal cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged) - Q_PROPERTY(qreal cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged) public: QQuickTableViewAttached(QObject *parent) @@ -165,31 +163,11 @@ public: Q_EMIT tableViewChanged(); } - qreal cellWidth() const { return m_cellWidth; } - void setCellWidth(qreal newWidth) { - if (newWidth == m_cellWidth) - return; - m_cellWidth = newWidth; - Q_EMIT cellWidthChanged(); - } - - qreal cellHeight() const { return m_cellHeight; } - void setCellHeight(qreal newHeight) { - if (newHeight == m_cellHeight) - return; - m_cellHeight = newHeight; - Q_EMIT cellHeightChanged(); - } - Q_SIGNALS: void tableViewChanged(); - void cellWidthChanged(); - void cellHeightChanged(); private: QPointer<QQuickTableView> m_tableview; - QQmlNullableValue<qreal> m_cellWidth; - QQmlNullableValue<qreal> m_cellHeight; friend class QQuickTableViewPrivate; }; |