diff --git a/Core/Core.cc b/Core/Core.cc index 8ad484cd987bcf7bb0568a17bc8453116fa6ee82..003bc4639bff44c0cae8caf10835242f295940d0 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -260,6 +260,7 @@ Core::init() { connect( coreWidget_, SIGNAL( resizeApplication(int,int) ), this, SLOT( resizeApplication(int,int) ) ); connect( coreWidget_, SIGNAL( stopVideoCapture() ), this, SLOT( stopVideoCapture() ) ); connect( coreWidget_, SIGNAL( startVideoCapture(QString,int,bool) ), this, SLOT( startVideoCapture(QString,int,bool) ) ); + connect( coreWidget_, SIGNAL( dragOpenFile(QString)), this, SLOT(loadObject(QString))); connect(coreWidget_, SIGNAL(showPlugins()) , this, SLOT(slotShowPlugins())); diff --git a/Core/Core.hh b/Core/Core.hh index 2c706c5c8fae93db2d87ef282158a83ba3c2e917..d411d31b9726fc660c4ef0c34534ea1cb05dcb94 100644 --- a/Core/Core.hh +++ b/Core/Core.hh @@ -439,7 +439,7 @@ public slots: /** @name Basic functions * @{ */ //=========================================================================== -private: +private slots: /** \brief Load a new Object ( this may also be an ini or ofs file ) * * This function tries to get the type of data to be loaded from the filename diff --git a/widgets/coreWidget/CoreWidget.hh b/widgets/coreWidget/CoreWidget.hh index bc10bf26a4eb9b2ded481d5783c018a2b01e0a8e..14c3b0e9b829321ac210fe8727ba5b22fd9d0f86 100644 --- a/widgets/coreWidget/CoreWidget.hh +++ b/widgets/coreWidget/CoreWidget.hh @@ -903,13 +903,17 @@ public: /** @name Drag and Drop * @{ */ //=========================================================================== + + signals: + void dragOpenFile(QString _filename); + private slots: void startDrag( QMouseEvent* _event ); void dragEnterEvent(QDragEnterEvent* _event); void dropEvent( QDropEvent* _event ); - + /** @} */ private : diff --git a/widgets/coreWidget/dragAndDrop.cc b/widgets/coreWidget/dragAndDrop.cc index 389b9c6c0f1eb36bd31b98bc50a8272ab8386d06..520c50586686c75decbc82b3e2c202cec09c23e3 100644 --- a/widgets/coreWidget/dragAndDrop.cc +++ b/widgets/coreWidget/dragAndDrop.cc @@ -171,6 +171,15 @@ void CoreWidget::dropEvent ( QDropEvent* _event ) { _event->acceptProposedAction(); return; } + + // Dropped file information + if ( view.left ( 4 ) == QString("file://") ) { + _event->acceptProposedAction(); + emit dragOpenFile(view.remove(0,7)); + return; + } + + std::cerr << "Skipped unknown drop event : " << view.toStdString() << std::endl; }