@@ -30,6 +30,18 @@ QStringList MixersList::mimeTypes () const
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MixersList::dropEvent(QDropEvent *event)
|
||||||
|
{
|
||||||
|
QList<int> list;
|
||||||
|
foreach(QListWidgetItem *item, selectedItems()) {
|
||||||
|
int idx= item->data(Qt::UserRole).toByteArray().at(0);
|
||||||
|
if(idx >= 0) list << idx;
|
||||||
|
}
|
||||||
|
if (list.count()<1) return;
|
||||||
|
event->acceptProposedAction();
|
||||||
|
dropMimeData(indexAt(event->pos()).row(),event->mimeData(),event->dropAction());
|
||||||
|
}
|
||||||
|
|
||||||
bool MixersList::dropMimeData( int index, const QMimeData * data, Qt::DropAction action )
|
bool MixersList::dropMimeData( int index, const QMimeData * data, Qt::DropAction action )
|
||||||
{
|
{
|
||||||
// qDebug() << "MixersList::dropMimeData() index:" << index << "formats" << data->formats();
|
// qDebug() << "MixersList::dropMimeData() index:" << index << "formats" << data->formats();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class MixersList : public QListWidget
|
|||||||
public:
|
public:
|
||||||
explicit MixersList(QWidget *parent, bool expo);
|
explicit MixersList(QWidget *parent, bool expo);
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
void dropEvent(QDropEvent *event);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void mimeDropped(int index, const QMimeData *data, Qt::DropAction action);
|
void mimeDropped(int index, const QMimeData *data, Qt::DropAction action);
|
||||||
|
|||||||
@@ -428,11 +428,18 @@ void MixesPanel::mixerlistWidget_customContextMenuRequested(QPoint pos)
|
|||||||
contextMenu.exec(globalPos);
|
contextMenu.exec(globalPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixesPanel::mimeMixerDropped(int index, const QMimeData *data, Qt::DropAction /*action*/)
|
void MixesPanel::mimeMixerDropped(int index, const QMimeData *data, Qt::DropAction action)
|
||||||
{
|
{
|
||||||
int idx= MixerlistWidget->item(index > 0 ? index-1 : 0)->data(Qt::UserRole).toByteArray().at(0);
|
int idx= MixerlistWidget->item(index > 0 ? index-1 : 0)->data(Qt::UserRole).toByteArray().at(0);
|
||||||
//qDebug() << "MixesPanel::mimeMixerDropped()" << index << data;
|
//qDebug() << "MixesPanel::mimeMixerDropped()" << index << data;
|
||||||
pasteMixerMimeData(data, idx);
|
if (action==Qt::CopyAction) {
|
||||||
|
pasteMixerMimeData(data, idx);
|
||||||
|
}
|
||||||
|
else if (action==Qt::MoveAction) {
|
||||||
|
QList<int> list = createMixListFromSelected();
|
||||||
|
mixersDeleteList(list);
|
||||||
|
pasteMixerMimeData(data, idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixesPanel::mixesEdited()
|
void MixesPanel::mixesEdited()
|
||||||
|
|||||||
Reference in New Issue
Block a user