- start FreeCAD
- open the attached document
- Drag MeshGroup001 out of FEMMeshGmsh001 and Drop it into FEMMeshGmsh
- Drop does work
- Drag does not work
- The MeshGroup001 is still a member of FEMMeshGmsh001 but it should have been moved
Is there an error in the implementation or this an intended behave?
code: https://github.com/FreeCAD/FreeCAD/blob ... #L173-L240
OS: Debian GNU/Linux 10 (buster) (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17331 (Git)
Build type: Unknown
Branch: master
Hash: cf18161dc26267c259ac21675cb9637263bf4152
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
drag and drop in tree view drag does not work
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: drag and drop in tree view drag does not work
- it works if MeshGroup001 is draged out of FEMMeshGmsh001 into the document first and afterwards dropped into the FEMMeshGmsh
- Is there a preference or something else to move an object instead of just add it tho another ?
- Is there a preference or something else to move an object instead of just add it tho another ?
Re: drag and drop in tree view drag does not work
In Qt a QDropEvent provides several kind of drop-actions: https://doc.qt.io/qt-5/qdropevent.html#dropAction
When just dragging an item with the cursor then a Qt::CopyAction is done which as its name says copies an item from one group to another group.
When the type is set to Qt::MoveAction then the item is really moved from one group to the other.
A Qt::MoveAction is set when pressing the Shift key while starting the drag/drop. But I don't know where this behaviour is implemented -- I assume it's Qt but don't know for sure.
When just dragging an item with the cursor then a Qt::CopyAction is done which as its name says copies an item from one group to another group.
When the type is set to Qt::MoveAction then the item is really moved from one group to the other.
A Qt::MoveAction is set when pressing the Shift key while starting the drag/drop. But I don't know where this behaviour is implemented -- I assume it's Qt but don't know for sure.
Re: drag and drop in tree view drag does not work
I have created a QTreeWidget inside QtDesigner and enabled its acceptDrops property and set dragDropMode to DragDrop.
Now when dragging items around it copies them and when pressing the Shift key the items are moved. So, the behaviour is done by Qt.
However, there is also the property defaultDropAction that can be set to MoveAction and then by default items are moved when dragging/dropping them and you have to press the Ctrl key to copy them.
Now when dragging items around it copies them and when pressing the Shift key the items are moved. So, the behaviour is done by Qt.
However, there is also the property defaultDropAction that can be set to MoveAction and then by default items are moved when dragging/dropping them and you have to press the Ctrl key to copy them.
Re: drag and drop in tree view drag does not work
git commit 747a2823e I guess MoveAction is the more intuitive behaviour.
Re: drag and drop in tree view drag does not work
good to know and works great here
+1wmayer wrote: ↑Thu Jul 11, 2019 5:09 pm git commit 747a2823e I guess MoveAction is the more intuitive behaviour.