+ {
+ if( this->m_DraggedBlock == NULL )
+ {
+ QTreeWidget* tree = dynamic_cast< QTreeWidget* >( event->source( ) );
+ if( tree != NULL )
+ {
+ // Process dropped data
+ QList< QTreeWidgetItem* > items = tree->selectedItems( );
+ for( QTreeWidgetItem* item : items )
+ {
+ std::string name = "";
+ QTreeWidgetItem* p = item;
+ while( p != NULL )
+ {
+ name += p->text( 0 ).toStdString( ) + "@";
+ p = p->parent( );
+
+ } // elihw
+ name.resize( name.size( ) - 1 );
+
+ // Create block
+ this->m_DraggedBlock = this->createBlock( name );
+ QPoint drop_pos = event->pos( );
+ QPointF scene_pos = this->mapToScene( drop_pos );
+ this->m_DraggedBlock->setPos( scene_pos );
+
+ } // rof
+
+ } // fi
+
+ } // fi