Bug 253165

Summary: Moving legends in layout mode crashes kst2
Product: [Applications] kst Reporter: Nicolas Brisset <nicolas.brisset>
Component: generalAssignee: kst
Severity: crash    
Priority: HI    
Version: 2.0.1   
Target Milestone: 2.0.1   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nicolas Brisset 2010-10-03 22:49:27 UTC
Version:           2.0.1
OS:                Linux

There is a bug in the code handling view items (at least legends), which seem to be attached to the wrong parent at the end of the move event, which finally results in a crash.

Reproducible: Always

Steps to Reproduce:
- load all 3 colums from gyrodata.dat, each in its plot and with legends displayed
- move to layout mode
- click on the legend of the second plot and drag it a few pixels below: it jumps to the third plot!
- drag it up to plot #2: it comes back to plot #3
- drag it again to plot #2: crash!

Expected Results:  
The view item (legend) should stay in the right plot and kst should not crash!

I have tried with a few different view objects (label, rectangle) and the problem happens with all of them.
Comment 1 Peter Kümmel 2010-10-04 21:44:30 UTC
SVN commit 1182510 by kuemmel:

Fix crash: items have a new QGraphicsItem as parent not a new QObject (here a tab page)

CCBUG: 253165

 M  +2 -2      viewitem.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1182510
Comment 2 Netterfield 2010-10-22 03:37:14 UTC
SVN commit 1188329 by netterfield:

BUG: 253165

Drop events are handled by the scene, which works in scene coordinates.  This was confusing the
GraphicsItems which work in their parent's coordinates.  Hence, meyhem.

This fix just converts the drop event back into parental coordinates in the viewitem.

I think this changed when d&d was being implemented to fix 258885.

 M  +8 -2      viewitem.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1188329
Comment 3 Nicolas Brisset 2010-10-22 07:55:59 UTC
Cool :-) It works much better now!

We should discuss what we still need to do (if anything) before releasing 2.0.1.
Comment 4 Peter Kümmel 2010-11-12 10:37:17 UTC
There is no version list for "Version Fixed in".
Use Target Milestone as indicator when the bug was fixed.