aboutsummaryrefslogtreecommitdiff
path: root/qmpplistwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmpplistwindow.cpp')
-rw-r--r--qmpplistwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/qmpplistwindow.cpp b/qmpplistwindow.cpp
index 85c33a3..a930a1d 100644
--- a/qmpplistwindow.cpp
+++ b/qmpplistwindow.cpp
@@ -3,6 +3,8 @@
#include <QFileDialog>
#include <QDirIterator>
#include <QSettings>
+#include <QUrl>
+#include <QMimeData>
#include "qmpplistwindow.hpp"
#include "ui_qmpplistwindow.h"
#include "qmpmainwindow.hpp"
@@ -100,6 +102,20 @@ void qmpPlistWindow::moveEvent(QMoveEvent *event)
}
}
+void qmpPlistWindow::dropEvent(QDropEvent *event)
+{
+ QList<QUrl> l=event->mimeData()->urls();
+ QStringList sl;
+ for(int i=0;i<l.size();++i)
+ sl.push_back(l.at(i).path());
+ insertItems(sl);
+}
+void qmpPlistWindow::dragEnterEvent(QDragEnterEvent *event)
+{
+ //if(event->mimeData()->hasFormat("application/x-midi"))
+ event->acceptProposedAction();
+}
+
void qmpPlistWindow::emptyList()
{
ui->lwFiles->clear();
@@ -108,6 +124,10 @@ void qmpPlistWindow::insertItem(QString i)
{
ui->lwFiles->addItem(new QListWidgetItem(i));
}
+void qmpPlistWindow::insertItems(QStringList il)
+{
+ ui->lwFiles->addItems(il);
+}
void qmpPlistWindow::on_pbAdd_clicked()
{