Droping dataset to the last subgroup of the data tree crash the application
Mantis Issue 947, reported by mgrizonnet, assigned to salbert, created: 2014-06-11
Step to reproduce:
- Import a dataset
- Create a "New group" which will be under the "Temporary" group
- Drop the dataset in this group.
The problem is located here:
http://hg.orfeo-toolbox.org/Monteverdi2/file/b415533b5765/Code/Common/Gui/mvdTreeWidget.cxx#l432
"itemAt" method return a NULL pointer in that case.
Note that this core dumped only appear the first time that you drop a dataset in the group.
I think that I'm using QT version 4.8.6
1408543298 - salbertSee e-mail sent to OTB-developers on August 20th, 2014.
Reproduced under:
- Ubuntu12.04-64bits with Qt 4.8.1 ;
- Win7-vc10-x86-RelWithDebInfo-Static with Qt 4.7.1
When moving a dataset to a newly created group, which is then the last item of the DatabaseBrowser, the function QTreeWidget::itemAt( const QPoint & ) returns NULL, Monteverdi2 asserts or crashes.
The QTreeWidget::itemAt() function should return a non-NULL value since we ended drag-n-drop with the mouse cursor over an existing QTreeWidgetItem. By the way, the item is correctly detected by the Qt engine since it has updated the mouse cursor to notice a valid drop target.
The QTreeWidget::itemAt() function is used to pick-up the item over which the drag-n-drop ended since QTreeWidget does not signal it. This step is necessary to determine the new parent item under which the item is moved th