diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/quick/items/qquicktableview.cpp | 16 | ||||
| -rw-r--r-- | src/quick/items/qquicktableview_p_p.h | 4 | ||||
| -rw-r--r-- | src/quickdialogs/quickdialogsquickimpl/qquickcolordialogimpl.cpp | 4 | ||||
| -rw-r--r-- | src/quicktemplates/qquickselectionrectangle.cpp | 6 |
4 files changed, 30 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; } } } diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h index 40763b340e..d53a7f5162 100644 --- a/src/quick/items/qquicktableview_p_p.h +++ b/src/quick/items/qquicktableview_p_p.h @@ -305,7 +305,9 @@ public: bool alternatingRows = true; bool resizableColumns = false; bool resizableRows = false; +#if QT_CONFIG(cursor) bool m_cursorSet = false; +#endif // isTransposed is currently only used by HeaderView. // Consider making it public. @@ -479,7 +481,9 @@ public: void scheduleRebuildTable(QQuickTableViewPrivate::RebuildOptions options); +#if QT_CONFIG(cursor) void updateCursor(); +#endif void updateEditItem(); QTypeRevision resolveImportVersion(); diff --git a/src/quickdialogs/quickdialogsquickimpl/qquickcolordialogimpl.cpp b/src/quickdialogs/quickdialogsquickimpl/qquickcolordialogimpl.cpp index 6f13403766..9721bae736 100644 --- a/src/quickdialogs/quickdialogsquickimpl/qquickcolordialogimpl.cpp +++ b/src/quickdialogs/quickdialogsquickimpl/qquickcolordialogimpl.cpp @@ -114,7 +114,9 @@ void QQuickColorDialogImplPrivate::eyeDropperEnter() [this](QPoint pos) { eyeDropperPointerMoved(pos); })); if (m_eyeDropperWindow->setMouseGrabEnabled(true)) { +#if QT_CONFIG(cursor) QGuiApplication::setOverrideCursor(Qt::CrossCursor); +#endif m_eyeDropperWindow->installEventFilter(eyeDropperEventFilter.get()); m_eyeDropperMode = true; } @@ -140,7 +142,9 @@ void QQuickColorDialogImplPrivate::eyeDropperLeave( m_eyeDropperWindow->removeEventFilter(eyeDropperEventFilter.get()); m_eyeDropperWindow->setMouseGrabEnabled(false); +#if QT_CONFIG(cursor) QGuiApplication::restoreOverrideCursor(); +#endif m_eyeDropperMode = false; m_eyeDropperWindow.clear(); diff --git a/src/quicktemplates/qquickselectionrectangle.cpp b/src/quicktemplates/qquickselectionrectangle.cpp index dedde0858a..95e28fd1ca 100644 --- a/src/quicktemplates/qquickselectionrectangle.cpp +++ b/src/quicktemplates/qquickselectionrectangle.cpp @@ -315,7 +315,9 @@ QQuickItem *QQuickSelectionRectanglePrivate::createHandle(QQmlComponent *delegat QQuickHoverHandler *hoverHandler = new QQuickHoverHandler(); hoverHandler->setTarget(nullptr); hoverHandler->setParentItem(handleItem); +#if QT_CONFIG(cursor) hoverHandler->setCursorShape(Qt::SizeFDiagCursor); +#endif hoverHandler->setBlocking(true); // Add a dummy TapHandler that blocks the user from being @@ -339,12 +341,16 @@ QQuickItem *QQuickSelectionRectanglePrivate::createHandle(QQmlComponent *delegat m_draggedHandle = handleItem; updateHandles(); updateDraggingState(true); +#if QT_CONFIG(cursor) QGuiApplication::setOverrideCursor(Qt::SizeFDiagCursor); +#endif } else { m_scrollTimer.stop(); m_selectable->normalizeSelection(); updateDraggingState(false); +#if QT_CONFIG(cursor) QGuiApplication::restoreOverrideCursor(); +#endif } }); |
