| 485 | } |
| 486 | |
| 487 | Point Widget::MapFromGlobal(const Point& pos) const |
| 488 | { |
| 489 | Point p = pos; |
| 490 | for (const Widget* cur = this; cur != nullptr; cur = cur->Parent()) |
| 491 | { |
| 492 | if (cur->DispWindow) |
| 493 | { |
| 494 | return p - cur->GetFrameGeometry().topLeft(); |
| 495 | } |
| 496 | p -= cur->ContentGeometry.topLeft(); |
| 497 | } |
| 498 | throw std::runtime_error("MapFromGlobal: no window widget found"); |
| 499 | } |
| 500 | |
| 501 | Point Widget::MapTo(const Widget* parent, const Point& pos) const |
| 502 | { |
nothing calls this directly
no test coverage detected