MCPcopy Create free account
hub / github.com/LMMS/lmms / dropEvent

Method dropEvent

src/gui/AutomationPatternView.cpp:442–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440
441
442void AutomationPatternView::dropEvent( QDropEvent * _de )
443{
444 QString type = StringPairDrag::decodeKey( _de );
445 QString val = StringPairDrag::decodeValue( _de );
446 if( type == "automatable_model" )
447 {
448 AutomatableModel * mod = dynamic_cast<AutomatableModel *>(
449 Engine::projectJournal()->
450 journallingObject( val.toInt() ) );
451 if( mod != NULL )
452 {
453 bool added = m_pat->addObject( mod );
454 if ( !added )
455 {
456 TextFloat::displayMessage( mod->displayName(),
457 tr( "Model is already connected "
458 "to this pattern." ),
459 embed::getIconPixmap( "automation" ),
460 2000 );
461 }
462 }
463 update();
464
465 if( gui->automationEditor() &&
466 gui->automationEditor()->currentPattern() == m_pat )
467 {
468 gui->automationEditor()->setCurrentPattern( m_pat );
469 }
470 }
471 else
472 {
473 TrackContentObjectView::dropEvent( _de );
474 }
475}
476
477
478

Callers

nothing calls this directly

Calls 7

projectJournalFunction · 0.85
getIconPixmapFunction · 0.85
journallingObjectMethod · 0.80
addObjectMethod · 0.80
displayNameMethod · 0.45
currentPatternMethod · 0.45
setCurrentPatternMethod · 0.45

Tested by

no test coverage detected