[qet] qet/qet: [4951] Fix crash : Qet crash when we save a project and the element collection is not loaded.

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


Revision: 4951
Author:   blacksun
Date:     2017-04-29 19:51:55 +0200 (Sat, 29 Apr 2017)
Log Message:
-----------
Fix crash : Qet crash when we save a project and the element collection is not loaded.

Modified Paths:
--------------
    trunk/sources/ElementsCollection/elementscollectionwidget.cpp

Modified: trunk/sources/ElementsCollection/elementscollectionwidget.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionwidget.cpp	2017-04-29 13:03:35 UTC (rev 4950)
+++ trunk/sources/ElementsCollection/elementscollectionwidget.cpp	2017-04-29 17:51:55 UTC (rev 4951)
@@ -46,6 +46,14 @@
 	QWidget(parent),
 	m_model(nullptr)
 {
+		//The connection in the method ElementsCollectionWidget::reload  return a warning message at compilation :
+		//**********
+		//QObject::connect: Cannot queue arguments of type 'QVector<int>'
+		//(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
+		//**********
+		//Register meta type has recommended by the message.
+	qRegisterMetaType<QVector<int>>();
+	
 	setUpWidget();
 	setUpAction();
 	setUpConnection();
@@ -103,7 +111,8 @@
  */
 void ElementsCollectionWidget::highlightUnusedElement()
 {
-	m_model->highlightUnusedElement();
+	if (m_model)
+		m_model->highlightUnusedElement();
 }
 
 bool ElementsCollectionWidget::event(QEvent *event)


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