diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-01-14 21:47:06 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-01-14 21:47:06 +0800 |
commit | 1e1036e705b20ea407bbb922e40c0f44147b3691 (patch) | |
tree | fe0d5560c3c44be62de50b8e433b81da0a135f70 /qmpplistwindow.cpp | |
parent | fab7ae34311b9bbb001c98baafa4b1a99aa3c18f (diff) | |
download | QMidiPlayer-1e1036e705b20ea407bbb922e40c0f44147b3691.tar.xz |
Innocent Treasure. (WTF)
Diffstat (limited to 'qmpplistwindow.cpp')
-rw-r--r-- | qmpplistwindow.cpp | 20 |
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() { |