| 801 | } |
| 802 | |
| 803 | CartesianPlot* WorksheetView::plotAt(QPoint pos) const { |
| 804 | QGraphicsItem* item = itemAt(pos); |
| 805 | if (!item) |
| 806 | return nullptr; |
| 807 | |
| 808 | QGraphicsItem* plotItem = nullptr; |
| 809 | if (item->data(0).toInt() == static_cast<int>(AspectType::CartesianPlot)) |
| 810 | plotItem = item; |
| 811 | else { |
| 812 | if (item->parentItem() && item->parentItem()->data(0).toInt() == static_cast<int>(AspectType::CartesianPlot)) |
| 813 | plotItem = item->parentItem(); |
| 814 | } |
| 815 | |
| 816 | if (plotItem == nullptr) |
| 817 | return nullptr; |
| 818 | |
| 819 | CartesianPlot* plot = nullptr; |
| 820 | for (auto* p : m_worksheet->children<CartesianPlot>()) { |
| 821 | if (p->graphicsItem() == plotItem) { |
| 822 | plot = p; |
| 823 | break; |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | return plot; |
| 828 | } |
| 829 | |
| 830 | // ############################################################################## |
| 831 | // #################################### Events ############################### |
nothing calls this directly
no test coverage detected