[qet] [3915] Minor bug fix : element editor, finish add text or terminal, add the current part in the part list,

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


Revision: 3915
Author:   blacksun
Date:     2015-04-18 12:30:05 +0200 (Sat, 18 Apr 2015)
Log Message:
-----------
Minor bug fix : element editor, finish add text or terminal, add the current part in the part list,
but the part doesn't exist after the event interface was deleted.

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

Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp	2015-04-17 15:50:57 UTC (rev 3914)
+++ trunk/sources/editor/elementscene.cpp	2015-04-18 10:30:05 UTC (rev 3915)
@@ -72,8 +72,8 @@
 	if (m_event_interface) {
 		if (m_event_interface -> mouseMoveEvent(e)) {
 			if (m_event_interface->isFinish()) {
+				delete m_event_interface; m_event_interface = nullptr;
 				emit(partsAdded());
-				delete m_event_interface; m_event_interface = nullptr;
 			}
 			return;
 		}
@@ -101,8 +101,8 @@
 	if (m_event_interface) {
 		if (m_event_interface -> mousePressEvent(e)) {
 			if (m_event_interface->isFinish()) {
+				delete m_event_interface; m_event_interface = nullptr;
 				emit(partsAdded());
-				delete m_event_interface; m_event_interface = nullptr;
 			}
 			return;
 		}
@@ -119,8 +119,8 @@
 	if (m_event_interface) {
 		if (m_event_interface -> mouseReleaseEvent(e)) {
 			if (m_event_interface->isFinish()) {
+				delete m_event_interface; m_event_interface = nullptr;
 				emit(partsAdded());
-				delete m_event_interface; m_event_interface = nullptr;
 			}
 			return;
 		}
@@ -145,8 +145,8 @@
 	if (m_event_interface) {
 		if (m_event_interface -> mouseDoubleClickEvent(event)) {
 			if (m_event_interface->isFinish()) {
+				delete m_event_interface; m_event_interface = nullptr;
 				emit(partsAdded());
-				delete m_event_interface; m_event_interface = nullptr;
 			}
 			return;
 		}
@@ -164,8 +164,8 @@
 	if (m_event_interface) {
 		if (m_event_interface -> keyPressEvent(event)) {
 			if (m_event_interface->isFinish()) {
+				delete m_event_interface; m_event_interface = nullptr;
 				emit(partsAdded());
-				delete m_event_interface; m_event_interface = nullptr;
 			}
 			return;
 		}


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