MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / dropEvent

Method dropEvent

Telegram/SourceFiles/dialogs/dialogs_widget.cpp:3374–3394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3372}
3373
3374void Widget::dropEvent(QDropEvent *e) {
3375 _chooseByDragTimer.cancel();
3376 if (_scroll->geometry().contains(e->pos())) {
3377 const auto globalPosition = mapToGlobal(e->pos());
3378 const auto thread = _suggestions
3379 ? _suggestions->updateFromParentDrag(globalPosition)
3380 : _inner->updateFromParentDrag(globalPosition);
3381 if (thread) {
3382 e->setDropAction(Qt::CopyAction);
3383 e->accept();
3384 controller()->content()->filesOrForwardDrop(
3385 thread,
3386 e->mimeData());
3387 if (!thread->owningHistory()->isForum()) {
3388 hideChildList();
3389 }
3390 controller()->widget()->raise();
3391 controller()->widget()->activateWindow();
3392 }
3393 }
3394}
3395
3396void Widget::listScrollUpdated() {
3397 const auto scrollTop = _scroll->scrollTop();

Callers

nothing calls this directly

Calls 10

filesOrForwardDropMethod · 0.80
cancelMethod · 0.45
containsMethod · 0.45
geometryMethod · 0.45
updateFromParentDragMethod · 0.45
contentMethod · 0.45
isForumMethod · 0.45
owningHistoryMethod · 0.45
raiseMethod · 0.45
widgetMethod · 0.45

Tested by

no test coverage detected