diff options
author | Ken Moore <ken@ixsystems.com> | 2017-11-02 12:46:25 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-11-02 12:46:25 -0400 |
commit | 70c29f04cd7dfbb1d70d533d7735bad19412271f (patch) | |
tree | fec62bf74f36d7694a18a1df17f36582dd5c5596 /src-qt5/desktop-utils/lumina-fm | |
parent | Fix up the drag and drop in lumina-fm. (diff) | |
download | lumina-70c29f04cd7dfbb1d70d533d7735bad19412271f.tar.gz lumina-70c29f04cd7dfbb1d70d533d7735bad19412271f.tar.bz2 lumina-70c29f04cd7dfbb1d70d533d7735bad19412271f.zip |
A bit more work on DD widgets.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h b/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h index 2ca0829d..7e4b1f22 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DDListWidgets.h @@ -160,6 +160,7 @@ public: this->setDragDropMode(QAbstractItemView::DragDrop); this->setDefaultDropAction(Qt::MoveAction); //prevent any built-in Qt actions - the class handles it this->setDropIndicatorShown(true); + this->setAcceptDrops(true); //Other custom properties necessary for the FM this->setFocusPolicy(Qt::StrongFocus); this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -201,7 +202,7 @@ protected: void dragEnterEvent(QDragEnterEvent *ev){ //qDebug() << "Drag Enter Event:" << ev->mimeData()->hasUrls() << this->whatsThis(); - QTreeWidget::dragEnterEvent(ev); + //QTreeWidget::dragEnterEvent(ev); if(ev->mimeData()->hasUrls() && !this->whatsThis().isEmpty() ){ ev->acceptProposedAction(); //allow this to be dropped here }else{ @@ -218,12 +219,14 @@ protected: if( this->whatsThis().startsWith(home) ){ ev->setDropAction(Qt::MoveAction); this->setCursor(Qt::DragMoveCursor); } else{ ev->setDropAction(Qt::CopyAction); this->setCursor(Qt::DragCopyCursor);} ev->acceptProposedAction(); //allow this to be dropped here - //this->setCursor(Qt::CrossCursor); + //this->setAcceptDrops(true); }else{ + //this->setAcceptDrops(false); this->setCursor(Qt::ForbiddenCursor); ev->ignore(); } - this->update(); + //this->setDropIndicatorShown(true); + //this->update(); //QTreeWidget::dragMoveEvent(ev); } |