[Kst] branches/work/kst/portto4/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Mon Jun 18 17:41:23 UTC 2012


SVN commit 1301721 by netterfield:

Don't invert Z order of viewItems which are direct children of the View.

Fixes Nicolas' bug "Arrows lose their z-order when saved and reloaded"


 M  +1 -1      document.cpp  
 M  +1 -1      view.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #1301720:1301721
@@ -92,7 +92,7 @@
     }
   }
 
-  if (i== n*n) {
+  if ((i== n*n) && (n>1)) {
     qDebug() << "Warning: loop detected, File will not be able to be loaded correctly!";
     while (!raw.isEmpty()) {
       DataObjectPtr D = raw.takeFirst();
--- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #1301720:1301721
@@ -164,7 +164,7 @@
 }
 
 void View::save(QXmlStreamWriter &xml) {
-  QList<QGraphicsItem*> items = scene()->items();
+  QList<QGraphicsItem*> items = scene()->items(Qt::AscendingOrder);
   xml.writeAttribute("width", QVariant(sceneRect().width()).toString());
   xml.writeAttribute("height", QVariant(sceneRect().height()).toString());
   xml.writeAttribute("color", backgroundBrush().color().name());


More information about the Kst mailing list