[qet] qet/qet: [4736] Fix crash : Element editor crash when we close it and several part of the same type ( for exemple ellipse) are selected. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
- To: qet@xxxxxxxxxxxxxxxxxxx
- Subject: [qet] qet/qet: [4736] Fix crash : Element editor crash when we close it and several part of the same type ( for exemple ellipse) are selected.
- From: subversion@xxxxxxxxxxxxx
- Date: Tue, 11 Oct 2016 20:34:03 +0200
Revision: 4736
Author: blacksun
Date: 2016-10-11 20:34:02 +0200 (Tue, 11 Oct 2016)
Log Message:
-----------
Fix crash : Element editor crash when we close it and several part of the same type (for exemple ellipse) are selected.
Thanks Morganol for find this crash
Modified Paths:
--------------
trunk/sources/editor/elementscene.cpp
trunk/sources/editor/qetelementeditor.cpp
Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp 2016-10-11 13:06:47 UTC (rev 4735)
+++ trunk/sources/editor/elementscene.cpp 2016-10-11 18:34:02 UTC (rev 4736)
@@ -779,14 +779,13 @@
}
/**
- Supprime les parties de l'element et les objets d'annulations.
- Les autres caracteristiques sont conservees.
-*/
+ * @brief ElementScene::reset
+ * Remove all QGraphicsItems in the scene and clear the undo stack.
+ */
void ElementScene::reset() {
- // supprime les objets d'annulation
+ clearSelection();
undoStack().clear();
- // enleve les elements de la scene
foreach (QGraphicsItem *qgi, items()) {
removeItem(qgi);
qgiManager().release(qgi);
Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp 2016-10-11 13:06:47 UTC (rev 4735)
+++ trunk/sources/editor/qetelementeditor.cpp 2016-10-11 18:34:02 UTC (rev 4736)
@@ -323,7 +323,7 @@
addToolBar(Qt::TopToolBarArea, view_toolbar);
addToolBar(Qt::TopToolBarArea, element_toolbar);
- connect(ce_scene, SIGNAL(selectionChanged()), this, SLOT(slot_updateInformations()));
+ connect(ce_scene, SIGNAL(selectionChanged()), this, SLOT(slot_updateInformations()), Qt::QueuedConnection);
connect(ce_scene, SIGNAL(selectionChanged()), this, SLOT(slot_updateMenus()));
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updateMenus()));
connect(&(ce_scene -> undoStack()), SIGNAL(cleanChanged(bool)), this, SLOT(slot_updateMenus()));