[Spreadsheet] Replace override cursor with QGraphicsItem::setCursor (#22097)

* [Spreadsheet] Replace the risky use of override cursor with
QGraphicsItem::setCursor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
xtemp09
2025-06-21 17:57:07 +07:00
committed by GitHub
parent b307395c59
commit eb8d8b68f0
3 changed files with 15 additions and 3 deletions

View File

@@ -122,6 +122,18 @@ ZoomableView::ZoomableView(Ui::Sheet* ui)
});
resetZoom();
auto connectCursorChangedSignal = [this](QHeaderView* hv) {
auto header = qobject_cast<SpreadsheetGui::SheetViewHeader*>(hv);
connect(header,
&SpreadsheetGui::SheetViewHeader::cursorChanged,
this,
[this](const QCursor& newerCursor) {
qpw->setCursor(newerCursor);
});
};
connectCursorChangedSignal(stv->horizontalHeader());
connectCursorChangedSignal(stv->verticalHeader());
}
int ZoomableView::zoomLevel() const