Commit 4fd00c7f authored by Jan Möbius's avatar Jan Möbius

Accept drag and drop for filenames

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8154 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a8228593
......@@ -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()));
......
......@@ -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
......
......@@ -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 :
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment