diff options
Diffstat (limited to 'lumina-fm/widgets/DDListWidgets.h')
-rw-r--r-- | lumina-fm/widgets/DDListWidgets.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lumina-fm/widgets/DDListWidgets.h b/lumina-fm/widgets/DDListWidgets.h index c211206b..d47c7ee4 100644 --- a/lumina-fm/widgets/DDListWidgets.h +++ b/lumina-fm/widgets/DDListWidgets.h @@ -20,6 +20,7 @@ #include <QDrag> #include <QFileInfo> #include <QDebug> +#include <QMouseEvent> //============== // LIST WIDGET @@ -84,11 +85,14 @@ protected: ev->setDropAction(Qt::CopyAction); } ev->accept(); //allow this to be dropped here - } + }else{ + ev->ignore(); + } } void dropEvent(QDropEvent *ev){ - if(this->whatsThis().isEmpty()){ return; } //not supported + if(this->whatsThis().isEmpty()){ ev->ignore(); return; } //not supported + //qDebug() << "Drop Event:"; ev->accept(); //handled here QString dirpath = this->whatsThis(); //See if the item under the drop point is a directory or not @@ -102,6 +106,11 @@ protected: //qDebug() << "Drop Event:" << dirpath; emit DataDropped( dirpath, QString(ev->mimeData()->data(MIME)).split("\n") ); } + + void mouseReleaseEvent(QMouseEvent *ev){ + if(ev->button() != Qt::RightButton && ev->button() != Qt::LeftButton){ ev->ignore(); } + else{ QListWidget::mouseReleaseEvent(ev); } //pass it along to the widget + } }; //================ @@ -185,5 +194,10 @@ protected: //qDebug() << "Drop Event:" << dirpath; emit DataDropped( dirpath, QString(ev->mimeData()->data(MIME)).split("\n") ); } + + void mouseReleaseEvent(QMouseEvent *ev){ + if(ev->button() != Qt::RightButton && ev->button() != Qt::LeftButton){ ev->ignore(); } + else{ QTreeWidget::mouseReleaseEvent(ev); } //pass it along to the widget + } }; #endif
\ No newline at end of file |