[qet] [1401] Made the NameList class usable with QVariant.

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


Revision: 1401
Author:   xavier
Date:     2011-12-23 18:41:16 +0100 (Fri, 23 Dec 2011)
Log Message:
-----------
Made the NameList class usable with QVariant.

Modified Paths:
--------------
    branches/0.3/sources/nameslist.cpp
    branches/0.3/sources/nameslist.h

Modified: branches/0.3/sources/nameslist.cpp
===================================================================
--- branches/0.3/sources/nameslist.cpp	2011-12-23 17:38:08 UTC (rev 1400)
+++ branches/0.3/sources/nameslist.cpp	2011-12-23 17:41:16 UTC (rev 1401)
@@ -16,6 +16,8 @@
 	along with QElectroTech.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include "nameslist.h"
+// make this class usable with QVariant
+int NamesList::MetaTypeId = qRegisterMetaType<NamesList>("NamesList");
 
 /**
 	Constructeur

Modified: branches/0.3/sources/nameslist.h
===================================================================
--- branches/0.3/sources/nameslist.h	2011-12-23 17:38:08 UTC (rev 1400)
+++ branches/0.3/sources/nameslist.h	2011-12-23 17:41:16 UTC (rev 1401)
@@ -37,6 +37,9 @@
 	private:
 	QHash<QString, QString> hash_names;
 	
+	public:
+	static int MetaTypeId;
+	
 	// methodes
 	public:
 	// methodes relatives a la gestion de la liste
@@ -59,4 +62,5 @@
 	protected:
 	QHash<QString, QString> getXmlOptions(const QHash<QString, QString> & = QHash<QString, QString>()) const;
 };
+Q_DECLARE_METATYPE(NamesList);
 #endif


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