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


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4736 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-10-11 18:34:02 +00:00
parent 70d3702655
commit a7ac265465
2 changed files with 5 additions and 6 deletions

View File

@@ -779,14 +779,13 @@ void ElementScene::getPasteArea(const QRectF &to_paste) {
} }
/** /**
Supprime les parties de l'element et les objets d'annulations. * @brief ElementScene::reset
Les autres caracteristiques sont conservees. * Remove all QGraphicsItems in the scene and clear the undo stack.
*/ */
void ElementScene::reset() { void ElementScene::reset() {
// supprime les objets d'annulation clearSelection();
undoStack().clear(); undoStack().clear();
// enleve les elements de la scene
foreach (QGraphicsItem *qgi, items()) { foreach (QGraphicsItem *qgi, items()) {
removeItem(qgi); removeItem(qgi);
qgiManager().release(qgi); qgiManager().release(qgi);

View File

@@ -323,7 +323,7 @@ void QETElementEditor::setupActions() {
addToolBar(Qt::TopToolBarArea, view_toolbar); addToolBar(Qt::TopToolBarArea, view_toolbar);
addToolBar(Qt::TopToolBarArea, element_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(ce_scene, SIGNAL(selectionChanged()), this, SLOT(slot_updateMenus()));
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updateMenus())); connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updateMenus()));
connect(&(ce_scene -> undoStack()), SIGNAL(cleanChanged(bool)), this, SLOT(slot_updateMenus())); connect(&(ce_scene -> undoStack()), SIGNAL(cleanChanged(bool)), this, SLOT(slot_updateMenus()));