diff options
| author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2022-02-23 15:40:03 +0100 |
|---|---|---|
| committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2022-03-02 09:07:44 +0100 |
| commit | e8d2f424a94bff37646819efbb7ac4b1ebfdc6ea (patch) | |
| tree | 207117f68614932d68aadf6a4cf19b2e8d196857 /src/quick/items/qquicktableview.cpp | |
| parent | dddd6a66ddd77d3887c52cb145e7e14b8fb542b9 (diff) | |
QQuickTableView: make some functions const
Change-Id: Ib552f25b5bdb252a5447cb49681a8fc9b72953cf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
| -rw-r--r-- | src/quick/items/qquicktableview.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index df676e5126..b20706bf0c 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1123,7 +1123,7 @@ int QQuickTableViewPrivate::modelIndexToCellIndex(const QModelIndex &modelIndex) return modelIndexAtCell(QPoint(modelIndex.column(), modelIndex.row())); } -int QQuickTableViewPrivate::edgeToArrayIndex(Qt::Edge edge) +int QQuickTableViewPrivate::edgeToArrayIndex(Qt::Edge edge) const { return int(log2(float(edge))); } @@ -1137,7 +1137,7 @@ void QQuickTableViewPrivate::clearEdgeSizeCache() cachedNextVisibleEdgeIndex[edgeToArrayIndex(edge)].startIndex = kEdgeIndexNotSet; } -int QQuickTableViewPrivate::nextVisibleEdgeIndexAroundLoadedTable(Qt::Edge edge) +int QQuickTableViewPrivate::nextVisibleEdgeIndexAroundLoadedTable(Qt::Edge edge) const { // Find the next column (or row) around the loaded table that is // visible, and should be loaded next if the content item moves. @@ -1152,7 +1152,7 @@ int QQuickTableViewPrivate::nextVisibleEdgeIndexAroundLoadedTable(Qt::Edge edge) return nextVisibleEdgeIndex(edge, startIndex); } -int QQuickTableViewPrivate::nextVisibleEdgeIndex(Qt::Edge edge, int startIndex) +int QQuickTableViewPrivate::nextVisibleEdgeIndex(Qt::Edge edge, int startIndex) const { // First check if we have already searched for the first visible index // after the given startIndex recently, and if so, return the cached result. @@ -2024,7 +2024,7 @@ qreal QQuickTableViewPrivate::getRowLayoutHeight(int row) return rowHeight; } -qreal QQuickTableViewPrivate::getColumnWidth(int column) +qreal QQuickTableViewPrivate::getColumnWidth(int column) const { // Return the width of the given column, if explicitly set. Return 0 if the column // is hidden, and -1 if the width is not set (which means that the width should @@ -2065,7 +2065,7 @@ qreal QQuickTableViewPrivate::getColumnWidth(int column) return columnWidth; } -qreal QQuickTableViewPrivate::getRowHeight(int row) +qreal QQuickTableViewPrivate::getRowHeight(int row) const { // Return the height of the given row, if explicitly set. Return 0 if the row // is hidden, and -1 if the height is not set (which means that the height should @@ -2106,14 +2106,14 @@ qreal QQuickTableViewPrivate::getRowHeight(int row) return rowHeight; } -bool QQuickTableViewPrivate::isColumnHidden(int column) +bool QQuickTableViewPrivate::isColumnHidden(int column) const { // A column is hidden if the width is explicit set to zero (either by // using a columnWidthProvider, or by overriding getColumnWidth()). return qFuzzyIsNull(getColumnWidth(column)); } -bool QQuickTableViewPrivate::isRowHidden(int row) +bool QQuickTableViewPrivate::isRowHidden(int row) const { // A row is hidden if the height is explicit set to zero (either by // using a rowHeightProvider, or by overriding getRowHeight()). @@ -4170,9 +4170,9 @@ void QQuickTableSectionSizeProvider::setSize(int section, qreal size) } // return -1.0 if no valid explicit size retrieved -qreal QQuickTableSectionSizeProvider::size(int section) +qreal QQuickTableSectionSizeProvider::size(int section) const { - Q_D(QQuickTableSectionSizeProvider); + Q_D(const QQuickTableSectionSizeProvider); auto it = d->hash.find(section); if (it != d->hash.end()) return *it; |
