Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/rasterimageview.cpp
Show First 20 Lines • Show All 460 Lines • ▼ Show 20 Line(s) | |||||
461 | { | 461 | { | ||
462 | if (d->mTool) { | 462 | if (d->mTool) { | ||
463 | d->mTool.data()->toolDeactivated(); | 463 | d->mTool.data()->toolDeactivated(); | ||
464 | d->mTool.data()->deleteLater(); | 464 | d->mTool.data()->deleteLater(); | ||
465 | } | 465 | } | ||
466 | 466 | | |||
467 | // Go back to default cursor when tool is deactivated. We need to call this here and | 467 | // Go back to default cursor when tool is deactivated. We need to call this here and | ||
468 | // not further below in case toolActivated wants to set its own new cursor afterwards. | 468 | // not further below in case toolActivated wants to set its own new cursor afterwards. | ||
469 | setToolActive(tool != nullptr); | ||||
469 | updateCursor(); | 470 | updateCursor(); | ||
470 | 471 | | |||
471 | d->mTool = tool; | 472 | d->mTool = tool; | ||
472 | if (d->mTool) { | 473 | if (d->mTool) { | ||
473 | d->mTool.data()->toolActivated(); | 474 | d->mTool.data()->toolActivated(); | ||
474 | } | 475 | } | ||
475 | currentToolChanged(tool); | 476 | currentToolChanged(tool); | ||
476 | update(); | 477 | update(); | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 564 | if (d->mTool) { | |||
564 | d->mTool.data()->hoverMoveEvent(event); | 565 | d->mTool.data()->hoverMoveEvent(event); | ||
565 | if (event->isAccepted()) { | 566 | if (event->isAccepted()) { | ||
566 | return; | 567 | return; | ||
567 | } | 568 | } | ||
568 | } | 569 | } | ||
569 | AbstractImageView::hoverMoveEvent(event); | 570 | AbstractImageView::hoverMoveEvent(event); | ||
570 | } | 571 | } | ||
571 | 572 | | |||
573 | void RasterImageView::focusInEvent(QFocusEvent* event) | ||||
574 | { | ||||
575 | if (d->mTool) { | ||||
576 | d->mTool.data()->focusInEvent(event); | ||||
577 | if (event->isAccepted()) { | ||||
578 | return; | ||||
579 | } | ||||
580 | } | ||||
581 | AbstractImageView::focusInEvent(event); | ||||
582 | } | ||||
583 | | ||||
572 | } // namespace | 584 | } // namespace |