diff options
| author | Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> | 2023-01-16 01:23:00 +0900 |
|---|---|---|
| committer | Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp> | 2023-01-17 00:36:26 +0900 |
| commit | 74b9c2a96f25b69002e5cbb261abf425c9f51a3d (patch) | |
| tree | cd576ae2f3499896ad6af3ba3e19f4d15a2ddae5 /src/quick/items/qquicktableview.cpp | |
| parent | 7409c217e8691beae5cd195fc8a0e3479de1db77 (diff) | |
Fix build with -no-feature-cursor
Pick-to: 6.5
Change-Id: Ibb89885c6cde3e49fffbc02f9c83880f2f2dda5d
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
| -rw-r--r-- | src/quick/items/qquicktableview.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 7dc2347d7c..83c3ebfe99 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -5075,6 +5075,7 @@ bool QQuickTableViewPrivate::editFromKeyEvent(QKeyEvent *e) return true; } +#if QT_CONFIG(cursor) void QQuickTableViewPrivate::updateCursor() { int row = resizableRows ? hoverHandler->m_row : -1; @@ -5109,6 +5110,7 @@ void QQuickTableViewPrivate::updateCursor() m_cursorSet = false; } } +#endif void QQuickTableViewPrivate::updateEditItem() { @@ -6323,9 +6325,11 @@ QQuickTableViewHoverHandler::QQuickTableViewHoverHandler(QQuickTableView *view) return; m_row = -1; m_column = -1; +#if QT_CONFIG(cursor) auto tableView = static_cast<QQuickTableView *>(parentItem()->parent()); auto tableViewPrivate = QQuickTableViewPrivate::get(tableView); tableViewPrivate->updateCursor(); +#endif }); } @@ -6334,14 +6338,18 @@ void QQuickTableViewHoverHandler::handleEventPoint(QPointerEvent *event, QEventP QQuickHoverHandler::handleEventPoint(event, point); auto tableView = static_cast<QQuickTableView *>(parentItem()->parent()); +#if QT_CONFIG(cursor) auto tableViewPrivate = QQuickTableViewPrivate::get(tableView); +#endif const QPoint cell = tableView->cellAtPosition(point.position(), true); const auto item = tableView->itemAtCell(cell); if (!item) { m_row = -1; m_column = -1; +#if QT_CONFIG(cursor) tableViewPrivate->updateCursor(); +#endif return; } @@ -6350,7 +6358,9 @@ void QQuickTableViewHoverHandler::handleEventPoint(QPointerEvent *event, QEventP const bool hoveringColumn = (itemPos.x() < margin() || itemPos.x() > item->width() - margin()); m_row = hoveringRow ? itemPos.y() < margin() ? cell.y() - 1 : cell.y() : -1; m_column = hoveringColumn ? itemPos.x() < margin() ? cell.x() - 1 : cell.x() : -1; +#if QT_CONFIG(cursor) tableViewPrivate->updateCursor(); +#endif } // ---------------------------------------------- @@ -6451,7 +6461,9 @@ void QQuickTableViewResizeHandler::updateState(QEventPoint &point) void QQuickTableViewResizeHandler::updateDrag(QPointerEvent *event, QEventPoint &point) { auto tableView = static_cast<QQuickTableView *>(parentItem()->parent()); +#if QT_CONFIG(cursor) auto tableViewPrivate = QQuickTableViewPrivate::get(tableView); +#endif switch (m_state) { case Listening: @@ -6469,7 +6481,9 @@ void QQuickTableViewResizeHandler::updateDrag(QPointerEvent *event, QEventPoint m_columnStartWidth = tableView->columnWidth(m_column); m_rowStartY = point.position().y(); m_rowStartHeight = tableView->rowHeight(m_row); +#if QT_CONFIG(cursor) tableViewPrivate->updateCursor(); +#endif // fallthrough case Dragging: { const qreal distX = point.position().x() - m_columnStartX; @@ -6481,7 +6495,9 @@ void QQuickTableViewResizeHandler::updateDrag(QPointerEvent *event, QEventPoint break; } case DraggingFinished: { tableView->setFiltersChildMouseEvents(true); +#if QT_CONFIG(cursor) tableViewPrivate->updateCursor(); +#endif break; } } } |
