[qet] [1469] Minor improvements in the TitleBlockTemplateLocation class.

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


Revision: 1469
Author:   xavier
Date:     2012-01-18 20:53:27 +0100 (Wed, 18 Jan 2012)
Log Message:
-----------
Minor improvements in the TitleBlockTemplateLocation class.

Modified Paths:
--------------
    branches/0.3/sources/titleblock/templatelocation.cpp
    branches/0.3/sources/titleblock/templatelocation.h

Modified: branches/0.3/sources/titleblock/templatelocation.cpp
===================================================================
--- branches/0.3/sources/titleblock/templatelocation.cpp	2012-01-15 19:26:40 UTC (rev 1468)
+++ branches/0.3/sources/titleblock/templatelocation.cpp	2012-01-18 19:53:27 UTC (rev 1469)
@@ -19,6 +19,9 @@
 #include "templatescollection.h"
 #include "qetapp.h"
 
+// make this class usable with QVariant
+int t = qRegisterMetaType<TitleBlockTemplateLocation>("TitleBlockTemplateLocation");
+
 /**
 	Constructor
 	@param collection Parent collection of the title block template
@@ -126,6 +129,15 @@
 
 /**
 	This is a convenience method equivalent to
+	parentCollection() -> getTemplateXmlDescription
+*/
+QDomElement TitleBlockTemplateLocation::getTemplateXmlDescription() const {
+	if (!collection_ || name_.isEmpty()) return(QDomElement());
+	return(collection_ -> getTemplateXmlDescription(name_));
+}
+
+/**
+	This is a convenience method equivalent to
 	parentCollection() -> getTemplate(...).
 */
 TitleBlockTemplate *TitleBlockTemplateLocation::getTemplate() const {

Modified: branches/0.3/sources/titleblock/templatelocation.h
===================================================================
--- branches/0.3/sources/titleblock/templatelocation.h	2012-01-15 19:26:40 UTC (rev 1468)
+++ branches/0.3/sources/titleblock/templatelocation.h	2012-01-18 19:53:27 UTC (rev 1469)
@@ -18,6 +18,7 @@
 #ifndef TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
 #define TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
 #include <QtCore>
+#include <QDomElement>
 class QETProject;
 class TitleBlockTemplate;
 class TitleBlockTemplatesCollection;
@@ -46,11 +47,15 @@
 	QString toString() const;
 	QETProject *parentProject() const;
 	QString protocol() const;
+	QDomElement getTemplateXmlDescription() const;
 	TitleBlockTemplate *getTemplate() const;
 	
 	// attributes
 	private:
 	TitleBlockTemplatesCollection *collection_; ///< Collection the template belongs to
 	QString name_;                              ///< Name of the template
+	
+	public:
+	static int MetaTypeId; ///< Id of the corresponding Qt meta type
 };
 #endif


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