| 297 | } |
| 298 | |
| 299 | bool DockWidget::eventFilter(QObject* watched, QEvent* event) { |
| 300 | if (object_widget_ != nullptr && content_widget_ != nullptr && isContentWidgetOrChild(watched, content_widget_) && |
| 301 | event != nullptr) { |
| 302 | switch (event->type()) { |
| 303 | case QEvent::ContextMenu: { |
| 304 | auto* context_event = static_cast<QContextMenuEvent*>(event); |
| 305 | showObjectContextMenu(context_event->globalPos()); |
| 306 | event->accept(); |
| 307 | return true; |
| 308 | } |
| 309 | // Catalog drops on the *live* content widget — once the placeholder |
| 310 | // is gone, this filter is the only thing that hears the drop. Used by |
| 311 | // multi-topic widgets (Scene3D) to absorb additional topics; a topic the |
| 312 | // committed widget can't host is rejected by onCatalogItemsDropped (no |
| 313 | // family-switching replacement — that only happens from the placeholder). |
| 314 | case QEvent::DragEnter: |
| 315 | case QEvent::DragMove: { |
| 316 | auto* drag = static_cast<QDropEvent*>(event); |
| 317 | if (drag->mimeData() != nullptr && drag->mimeData()->hasFormat(CurveTreeView::catalogItemsMimeType())) { |
| 318 | drag->acceptProposedAction(); |
| 319 | return true; |
| 320 | } |
| 321 | return false; |
| 322 | } |
| 323 | case QEvent::Drop: { |
| 324 | auto* drop = static_cast<QDropEvent*>(event); |
| 325 | const QStringList keys = CurveTreeView::decodeCatalogKeys(drop->mimeData()); |
| 326 | if (keys.isEmpty()) { |
| 327 | return false; |
| 328 | } |
| 329 | drop->acceptProposedAction(); |
| 330 | onCatalogItemsDropped(keys); |
| 331 | return true; |
| 332 | } |
| 333 | default: |
| 334 | break; |
| 335 | } |
| 336 | } |
| 337 | return ads::CDockWidget::eventFilter(watched, event); |
| 338 | } |
| 339 | |
| 340 | DockWidget* DockWidget::splitHorizontal() { |
| 341 | return splitHorizontal(nullptr); |
nothing calls this directly
no test coverage detected