| 511 | } |
| 512 | |
| 513 | Point Widget::MapToGlobal(const Point& pos) const |
| 514 | { |
| 515 | Point p = pos; |
| 516 | for (const Widget* cur = this; cur != nullptr; cur = cur->Parent()) |
| 517 | { |
| 518 | if (cur->DispWindow) |
| 519 | { |
| 520 | return cur->GetFrameGeometry().topLeft() + p; |
| 521 | } |
| 522 | p += cur->ContentGeometry.topLeft(); |
| 523 | } |
| 524 | throw std::runtime_error("MapFromGlobal: no window widget found"); |
| 525 | } |
| 526 | |
| 527 | void Widget::OnWindowPaint() |
| 528 | { |
nothing calls this directly
no test coverage detected