[PyQt] Undefined error with Drag & Drop

Hans Jörg Maurer hjm at pmeonline.net
Thu Jan 25 20:21:42 GMT 2018


Dear Scott,

thanks for your answer.

I have no idea where I should search. 

I've added some print commands to get an idea whats leading to the
mentioned fault. It seems that the eventFilter is the main call during
a drag & drop. I'm sorry, but I do pyqt since just a half a year and I
am still python beginner. So it its stupid, please tell me.
The following calls lead to the crash during drag & drop inside a
QTreeView. It's a log from the Run Window:


-> MaDaMain.eventFilter
   EventFilter Type         : QEvent.WindowActivate:Window
was activated.
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.WindowActivate:Window
was activated.
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  24
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseButtonPress:Mouse
press (QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  2
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.Paint:Screen update
necessary (QPaintEvent).
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.Paint:Screen update
necessary (QPaintEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverMove:The mouse
cursor moves inside a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  129
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.MouseMove:Mouse move
(QMouseEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  5
QtCore.QEvent.MouseMove
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.Leave:Mouse leaves
widget's boundaries.
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  11
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.HoverLeave:The mouse
cursor leaves a hover widget (QHoverEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  128
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragEnter:The cursor
enters a widget during a drag and drop operation (QDragEnterEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  60
   -> event.type() == QtCore.QEvent.DragEnter
   index: 
   Daten aus dem Model1:  S2  
   Daten aus dem Model3: {'col1': {'dbID': 3471, 'level': 1,
'long_name': ' S2  ', 'origin_source':
"{'LocationID':2,'LocationName':'S2 DE 1','LocationOrder':2}",
'origin_table': 'bla', 'parent_ID': 1639, 'pos': 41, 'short_name': '
S2  ', 'sort_order': 1}, 'col2': '', 'col3': '', 'col4': '', 'col5':
'', 'col6': ''}
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
62)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
65)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
66)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
68)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
69)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
70)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(64,
73)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(65,
76)
    source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  12
 MaDaMain.eventFilter
   EventFilter Type         : QEvent.DragMove:A drag and
drop operation is in progress (QDragMoveEvent).
   -> source == self.treeViewStructure.viewport()
-> treeViewStructure_eventFilter type:  61
   ->event.type() == QtCore.QEvent.DragMove
   index: 
   Data: {'col1': {'dbID': 3471, 'level': 1, 'long_name': ' S2  ',
'origin_source': "{'LocationID':2,'LocationName':'S2 DE
1','LocationOrder':2}", 'origin_table': 'bla', 'parent_ID': 1639,
'pos': 41, 'short_name': ' S2  ', 'sort_order': 1}, 'col2': '',
'col3': '', 'col4': '', 'col5': '', 'col6': ''}
                    pos: PyQt5.QtCore.QPoint(65,
79)
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180125/77516b40/attachment-0001.html>


More information about the PyQt mailing list