[qet] qet/qet: [5073] Set the ItemIndexMethod of scene to NoIndex, according to some forum ( Adress of forum are in the cpp file of this comit) they can be the sources of the crash occured by the conductor and shape " guost".

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5073
Author:   blacksun
Date:     2017-10-09 18:05:19 +0200 (Mon, 09 Oct 2017)
Log Message:
-----------
Set the ItemIndexMethod of scene to NoIndex, according to some forum (Adress of forum are in the cpp file of this comit) they can be the sources of the crash occured by the conductor and shape "guost". 

Modified Paths:
--------------
    trunk/sources/diagram.cpp
    trunk/sources/editor/elementscene.cpp

Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp	2017-10-08 21:49:13 UTC (rev 5072)
+++ trunk/sources/diagram.cpp	2017-10-09 16:05:19 UTC (rev 5073)
@@ -64,6 +64,13 @@
 	m_freeze_new_elements   (false),
 	m_freeze_new_conductors_ (false)
 {
+	setItemIndexMethod(QGraphicsScene::NoIndex);
+		//Set to no index, because they can be the source of the crash with conductor and shape ghost.
+		//https://forum.qt.io/topic/71316/qgraphicsscenefinditembsptreevisitor-visit-crashes-due-to-an-obsolete-paintevent-after-qgraphicsscene-removeitem
+		//https://stackoverflow.com/questions/38458830/crash-after-qgraphicssceneremoveitem-with-custom-item-class
+		//http://www.qtcentre.org/archive/index.php/t-33730.html
+		//http://tech-artists.org/t/qt-properly-removing-qgraphicitems/3063
+	
 	setProject(project);
 	qgi_manager_ = new QGIManager(this);
 	setBackgroundBrush(Qt::white);

Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp	2017-10-08 21:49:13 UTC (rev 5072)
+++ trunk/sources/editor/elementscene.cpp	2017-10-09 16:05:19 UTC (rev 5073)
@@ -49,6 +49,13 @@
 	m_qgi_manager(this),
 	m_element_editor(editor)
 {
+	setItemIndexMethod(QGraphicsScene::NoIndex);
+		//Set to no index, because they can be the source of the crash with conductor and shape ghost.
+		//https://forum.qt.io/topic/71316/qgraphicsscenefinditembsptreevisitor-visit-crashes-due-to-an-obsolete-paintevent-after-qgraphicsscene-removeitem
+		//https://stackoverflow.com/questions/38458830/crash-after-qgraphicssceneremoveitem-with-custom-item-class
+		//http://www.qtcentre.org/archive/index.php/t-33730.html
+		//http://tech-artists.org/t/qt-properly-removing-qgraphicitems/3063
+	
 	m_behavior = Normal;
 	setItemIndexMethod(NoIndex);
 	setGrid(1, 1);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/