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